Package org.apache.spark.ml.tree
Interface RandomForestParams
- All Superinterfaces:
DecisionTreeParams
,HasCheckpointInterval
,HasFeaturesCol
,HasLabelCol
,HasPredictionCol
,HasSeed
,HasWeightCol
,Identifiable
,Params
,PredictorParams
,Serializable
,scala.Serializable
,TreeEnsembleParams
- All Known Subinterfaces:
RandomForestClassifierParams
,RandomForestRegressorParams
- All Known Implementing Classes:
RandomForestClassificationModel
,RandomForestClassifier
,RandomForestRegressionModel
,RandomForestRegressor
Parameters for Random Forest algorithms.
-
Method Summary
Modifier and TypeMethodDescriptionWhether bootstrap samples are used when building trees.boolean
int
numTrees()
Number of trees to train (at least 1).Methods inherited from interface org.apache.spark.ml.tree.DecisionTreeParams
cacheNodeIds, getCacheNodeIds, getLeafCol, getMaxBins, getMaxDepth, getMaxMemoryInMB, getMinInfoGain, getMinInstancesPerNode, getMinWeightFractionPerNode, getOldStrategy, leafCol, maxBins, maxDepth, maxMemoryInMB, minInfoGain, minInstancesPerNode, minWeightFractionPerNode, setLeafCol
Methods inherited from interface org.apache.spark.ml.param.shared.HasCheckpointInterval
checkpointInterval, getCheckpointInterval
Methods inherited from interface org.apache.spark.ml.param.shared.HasFeaturesCol
featuresCol, getFeaturesCol
Methods inherited from interface org.apache.spark.ml.param.shared.HasLabelCol
getLabelCol, labelCol
Methods inherited from interface org.apache.spark.ml.param.shared.HasPredictionCol
getPredictionCol, predictionCol
Methods inherited from interface org.apache.spark.ml.param.shared.HasWeightCol
getWeightCol, weightCol
Methods inherited from interface org.apache.spark.ml.util.Identifiable
toString, uid
Methods inherited from interface org.apache.spark.ml.param.Params
clear, copy, copyValues, defaultCopy, defaultParamMap, explainParam, explainParams, extractParamMap, extractParamMap, get, getDefault, getOrDefault, getParam, hasDefault, hasParam, isDefined, isSet, onParamChange, paramMap, params, set, set, set, setDefault, setDefault, shouldOwn
Methods inherited from interface org.apache.spark.ml.PredictorParams
validateAndTransformSchema
Methods inherited from interface org.apache.spark.ml.tree.TreeEnsembleParams
featureSubsetStrategy, getFeatureSubsetStrategy, getOldStrategy, getSubsamplingRate, subsamplingRate
-
Method Details
-
bootstrap
BooleanParam bootstrap()Whether bootstrap samples are used when building trees.- Returns:
- (undocumented)
-
getBootstrap
boolean getBootstrap() -
getNumTrees
int getNumTrees() -
numTrees
IntParam numTrees()Number of trees to train (at least 1). If 1, then no bootstrapping is used. If greater than 1, then bootstrapping is done. TODO: Change to always do bootstrapping (simpler). SPARK-7130 (default = 20)Note: The reason that we cannot add this to both GBT and RF (i.e. in TreeEnsembleParams) is the param
maxIter
controls how many trees a GBT has. The semantics in the algorithms are a bit different.- Returns:
- (undocumented)
-