Package org.apache.spark.ml.tree
Interface RandomForestParams
- All Superinterfaces:
- DecisionTreeParams,- HasCheckpointInterval,- HasFeaturesCol,- HasLabelCol,- HasPredictionCol,- HasSeed,- HasWeightCol,- Identifiable,- Params,- PredictorParams,- Serializable,- TreeEnsembleParams
- All Known Subinterfaces:
- RandomForestClassifierParams,- RandomForestRegressorParams
- All Known Implementing Classes:
- RandomForestClassificationModel,- RandomForestClassifier,- RandomForestRegressionModel,- RandomForestRegressor
Parameters for Random Forest algorithms.
- 
Method SummaryModifier and TypeMethodDescriptionWhether bootstrap samples are used when building trees.booleanintnumTrees()Number of trees to train (at least 1).Methods inherited from interface org.apache.spark.ml.tree.DecisionTreeParamscacheNodeIds, getCacheNodeIds, getLeafCol, getMaxBins, getMaxDepth, getMaxMemoryInMB, getMinInfoGain, getMinInstancesPerNode, getMinWeightFractionPerNode, getOldStrategy, leafCol, maxBins, maxDepth, maxMemoryInMB, minInfoGain, minInstancesPerNode, minWeightFractionPerNode, setLeafColMethods inherited from interface org.apache.spark.ml.param.shared.HasCheckpointIntervalcheckpointInterval, getCheckpointIntervalMethods inherited from interface org.apache.spark.ml.param.shared.HasFeaturesColfeaturesCol, getFeaturesColMethods inherited from interface org.apache.spark.ml.param.shared.HasLabelColgetLabelCol, labelColMethods inherited from interface org.apache.spark.ml.param.shared.HasPredictionColgetPredictionCol, predictionColMethods inherited from interface org.apache.spark.ml.param.shared.HasWeightColgetWeightCol, weightColMethods inherited from interface org.apache.spark.ml.util.IdentifiabletoString, uidMethods inherited from interface org.apache.spark.ml.param.Paramsclear, copy, copyValues, defaultCopy, defaultParamMap, estimateMatadataSize, explainParam, explainParams, extractParamMap, extractParamMap, get, getDefault, getOrDefault, getParam, hasDefault, hasParam, isDefined, isSet, onParamChange, paramMap, params, set, set, set, setDefault, setDefault, shouldOwnMethods inherited from interface org.apache.spark.ml.PredictorParamsvalidateAndTransformSchemaMethods inherited from interface org.apache.spark.ml.tree.TreeEnsembleParamsfeatureSubsetStrategy, getFeatureSubsetStrategy, getOldStrategy, getSubsamplingRate, subsamplingRate
- 
Method Details- 
bootstrapBooleanParam bootstrap()Whether bootstrap samples are used when building trees.- Returns:
- (undocumented)
 
- 
getBootstrapboolean getBootstrap()
- 
getNumTreesint getNumTrees()
- 
numTreesIntParam 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 maxItercontrols how many trees a GBT has. The semantics in the algorithms are a bit different.- Returns:
- (undocumented)
 
 
-