Skip to content

Instantly share code, notes, and snippets.

@bfraiche
Last active April 2, 2019 22:08
Show Gist options
  • Save bfraiche/e147e879c964ef19101a0f490881ae3b to your computer and use it in GitHub Desktop.
Save bfraiche/e147e879c964ef19101a0f490881ae3b to your computer and use it in GitHub Desktop.
This gist contains code snippets for my blogpost: 'Random Forest with Python and Spark ML'
from pyspark.ml.tuning import ParamGridBuilder
import numpy as np
paramGrid = ParamGridBuilder() \
.addGrid(rf.numTrees, [int(x) for x in np.linspace(start = 10, stop = 50, num = 3)]) \
.addGrid(rf.maxDepth, [int(x) for x in np.linspace(start = 5, stop = 25, num = 3)]) \
.build()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment