DecisionTreeParams (Spark 3.5.5 JavaDoc) (original) (raw)
- All Superinterfaces:
HasCheckpointInterval, HasFeaturesCol, HasLabelCol, HasPredictionCol, HasSeed, HasWeightCol, Identifiable, Params, PredictorParams, java.io.Serializable
All Known Subinterfaces:
DecisionTreeClassifierParams, DecisionTreeRegressorParams, GBTClassifierParams, GBTParams, GBTRegressorParams, RandomForestClassifierParams, RandomForestParams, RandomForestRegressorParams, TreeEnsembleClassifierParams, TreeEnsembleParams, TreeEnsembleRegressorParams
All Known Implementing Classes:
DecisionTreeClassificationModel, DecisionTreeClassifier, DecisionTreeRegressionModel, DecisionTreeRegressor, GBTClassificationModel, GBTClassifier, GBTRegressionModel, GBTRegressor, RandomForestClassificationModel, RandomForestClassifier, RandomForestRegressionModel, RandomForestRegressor
public interface DecisionTreeParams
extends PredictorParams, HasCheckpointInterval, HasSeed, HasWeightCol
Parameters for Decision Tree-based algorithms.
Note: Marked as private since this may be made public in the future.
Method Summary
All Methods Instance Methods Abstract Methods
Modifier and Type Method and Description BooleanParam cacheNodeIds() If false, the algorithm will pass trees to executors to match instances with nodes. boolean getCacheNodeIds() String getLeafCol() int getMaxBins() int getMaxDepth() int getMaxMemoryInMB() double getMinInfoGain() int getMinInstancesPerNode() double getMinWeightFractionPerNode() Strategy getOldStrategy(scala.collection.immutable.Map<Object,Object> categoricalFeatures, int numClasses, scala.Enumeration.Value oldAlgo,Impurity oldImpurity, double subsamplingRate) (private[ml]) Create a Strategy instance to use with the old API. Param leafCol() Leaf indices column name. IntParam maxBins() Maximum number of bins used for discretizing continuous features and for choosing how to split on features at each node. IntParam maxDepth() Maximum depth of the tree (nonnegative). IntParam maxMemoryInMB() Maximum memory in MB allocated to histogram aggregation. DoubleParam minInfoGain() Minimum information gain for a split to be considered at a tree node. IntParam minInstancesPerNode() Minimum number of instances each child must have after split. DoubleParam minWeightFractionPerNode() Minimum fraction of the weighted sample count that each child must have after split. DecisionTreeParams setLeafCol(String value) * ### Methods inherited from interface org.apache.spark.ml.[PredictorParams](../../../../../org/apache/spark/ml/PredictorParams.html "interface in org.apache.spark.ml") `[validateAndTransformSchema](../../../../../org/apache/spark/ml/PredictorParams.html#validateAndTransformSchema-org.apache.spark.sql.types.StructType-boolean-org.apache.spark.sql.types.DataType-)` * ### Methods inherited from interface org.apache.spark.ml.param.shared.[HasLabelCol](../../../../../org/apache/spark/ml/param/shared/HasLabelCol.html "interface in org.apache.spark.ml.param.shared") `[getLabelCol](../../../../../org/apache/spark/ml/param/shared/HasLabelCol.html#getLabelCol--), [labelCol](../../../../../org/apache/spark/ml/param/shared/HasLabelCol.html#labelCol--)` * ### Methods inherited from interface org.apache.spark.ml.param.shared.[HasFeaturesCol](../../../../../org/apache/spark/ml/param/shared/HasFeaturesCol.html "interface in org.apache.spark.ml.param.shared") `[featuresCol](../../../../../org/apache/spark/ml/param/shared/HasFeaturesCol.html#featuresCol--), [getFeaturesCol](../../../../../org/apache/spark/ml/param/shared/HasFeaturesCol.html#getFeaturesCol--)` * ### Methods inherited from interface org.apache.spark.ml.param.shared.[HasPredictionCol](../../../../../org/apache/spark/ml/param/shared/HasPredictionCol.html "interface in org.apache.spark.ml.param.shared") `[getPredictionCol](../../../../../org/apache/spark/ml/param/shared/HasPredictionCol.html#getPredictionCol--), [predictionCol](../../../../../org/apache/spark/ml/param/shared/HasPredictionCol.html#predictionCol--)` * ### Methods inherited from interface org.apache.spark.ml.param.[Params](../../../../../org/apache/spark/ml/param/Params.html "interface in org.apache.spark.ml.param") `[clear](../../../../../org/apache/spark/ml/param/Params.html#clear-org.apache.spark.ml.param.Param-), [copy](../../../../../org/apache/spark/ml/param/Params.html#copy-org.apache.spark.ml.param.ParamMap-), [copyValues](../../../../../org/apache/spark/ml/param/Params.html#copyValues-T-org.apache.spark.ml.param.ParamMap-), [defaultCopy](../../../../../org/apache/spark/ml/param/Params.html#defaultCopy-org.apache.spark.ml.param.ParamMap-), [defaultParamMap](../../../../../org/apache/spark/ml/param/Params.html#defaultParamMap--), [explainParam](../../../../../org/apache/spark/ml/param/Params.html#explainParam-org.apache.spark.ml.param.Param-), [explainParams](../../../../../org/apache/spark/ml/param/Params.html#explainParams--), [extractParamMap](../../../../../org/apache/spark/ml/param/Params.html#extractParamMap--), [extractParamMap](../../../../../org/apache/spark/ml/param/Params.html#extractParamMap-org.apache.spark.ml.param.ParamMap-), [get](../../../../../org/apache/spark/ml/param/Params.html#get-org.apache.spark.ml.param.Param-), [getDefault](../../../../../org/apache/spark/ml/param/Params.html#getDefault-org.apache.spark.ml.param.Param-), [getOrDefault](../../../../../org/apache/spark/ml/param/Params.html#getOrDefault-org.apache.spark.ml.param.Param-), [getParam](../../../../../org/apache/spark/ml/param/Params.html#getParam-java.lang.String-), [hasDefault](../../../../../org/apache/spark/ml/param/Params.html#hasDefault-org.apache.spark.ml.param.Param-), [hasParam](../../../../../org/apache/spark/ml/param/Params.html#hasParam-java.lang.String-), [isDefined](../../../../../org/apache/spark/ml/param/Params.html#isDefined-org.apache.spark.ml.param.Param-), [isSet](../../../../../org/apache/spark/ml/param/Params.html#isSet-org.apache.spark.ml.param.Param-), [onParamChange](../../../../../org/apache/spark/ml/param/Params.html#onParamChange-org.apache.spark.ml.param.Param-), [paramMap](../../../../../org/apache/spark/ml/param/Params.html#paramMap--), [params](../../../../../org/apache/spark/ml/param/Params.html#params--), [set](../../../../../org/apache/spark/ml/param/Params.html#set-org.apache.spark.ml.param.Param-T-), [set](../../../../../org/apache/spark/ml/param/Params.html#set-org.apache.spark.ml.param.ParamPair-), [set](../../../../../org/apache/spark/ml/param/Params.html#set-java.lang.String-java.lang.Object-), [setDefault](../../../../../org/apache/spark/ml/param/Params.html#setDefault-org.apache.spark.ml.param.Param-T-), [setDefault](../../../../../org/apache/spark/ml/param/Params.html#setDefault-scala.collection.Seq-), [shouldOwn](../../../../../org/apache/spark/ml/param/Params.html#shouldOwn-org.apache.spark.ml.param.Param-)` * ### Methods inherited from interface org.apache.spark.ml.util.[Identifiable](../../../../../org/apache/spark/ml/util/Identifiable.html "interface in org.apache.spark.ml.util") `[toString](../../../../../org/apache/spark/ml/util/Identifiable.html#toString--), [uid](../../../../../org/apache/spark/ml/util/Identifiable.html#uid--)` * ### Methods inherited from interface org.apache.spark.ml.param.shared.[HasCheckpointInterval](../../../../../org/apache/spark/ml/param/shared/HasCheckpointInterval.html "interface in org.apache.spark.ml.param.shared") `[checkpointInterval](../../../../../org/apache/spark/ml/param/shared/HasCheckpointInterval.html#checkpointInterval--), [getCheckpointInterval](../../../../../org/apache/spark/ml/param/shared/HasCheckpointInterval.html#getCheckpointInterval--)` * ### Methods inherited from interface org.apache.spark.ml.param.shared.[HasSeed](../../../../../org/apache/spark/ml/param/shared/HasSeed.html "interface in org.apache.spark.ml.param.shared") `[getSeed](../../../../../org/apache/spark/ml/param/shared/HasSeed.html#getSeed--), [seed](../../../../../org/apache/spark/ml/param/shared/HasSeed.html#seed--)` * ### Methods inherited from interface org.apache.spark.ml.param.shared.[HasWeightCol](../../../../../org/apache/spark/ml/param/shared/HasWeightCol.html "interface in org.apache.spark.ml.param.shared") `[getWeightCol](../../../../../org/apache/spark/ml/param/shared/HasWeightCol.html#getWeightCol--), [weightCol](../../../../../org/apache/spark/ml/param/shared/HasWeightCol.html#weightCol--)`
Method Detail
* #### cacheNodeIds [BooleanParam](../../../../../org/apache/spark/ml/param/BooleanParam.html "class in org.apache.spark.ml.param") cacheNodeIds() If false, the algorithm will pass trees to executors to match instances with nodes. If true, the algorithm will cache node IDs for each instance. Caching can speed up training of deeper trees. Users can set how often should the cache be checkpointed or disable it by setting checkpointInterval. (default = false) Returns: (undocumented) * #### getCacheNodeIds boolean getCacheNodeIds() * #### getLeafCol String getLeafCol() * #### getMaxBins int getMaxBins() * #### getMaxDepth int getMaxDepth() * #### getMaxMemoryInMB int getMaxMemoryInMB() * #### getMinInfoGain double getMinInfoGain() * #### getMinInstancesPerNode int getMinInstancesPerNode() * #### getMinWeightFractionPerNode double getMinWeightFractionPerNode() * #### getOldStrategy [Strategy](../../../../../org/apache/spark/mllib/tree/configuration/Strategy.html "class in org.apache.spark.mllib.tree.configuration") getOldStrategy(scala.collection.immutable.Map<Object,Object> categoricalFeatures, int numClasses, scala.Enumeration.Value oldAlgo, [Impurity](../../../../../org/apache/spark/mllib/tree/impurity/Impurity.html "interface in org.apache.spark.mllib.tree.impurity") oldImpurity, double subsamplingRate) (private\[ml\]) Create a Strategy instance to use with the old API. * #### leafCol [Param](../../../../../org/apache/spark/ml/param/Param.html "class in org.apache.spark.ml.param")<String> leafCol() Leaf indices column name. Predicted leaf index of each instance in each tree by preorder. (default = "") Returns: (undocumented) * #### maxBins [IntParam](../../../../../org/apache/spark/ml/param/IntParam.html "class in org.apache.spark.ml.param") maxBins() Maximum number of bins used for discretizing continuous features and for choosing how to split on features at each node. More bins give higher granularity. Must be at least 2 and at least number of categories in any categorical feature. (default = 32) Returns: (undocumented) * #### maxDepth [IntParam](../../../../../org/apache/spark/ml/param/IntParam.html "class in org.apache.spark.ml.param") maxDepth() Maximum depth of the tree (nonnegative). E.g., depth 0 means 1 leaf node; depth 1 means 1 internal node + 2 leaf nodes. (default = 5) Returns: (undocumented) * #### maxMemoryInMB [IntParam](../../../../../org/apache/spark/ml/param/IntParam.html "class in org.apache.spark.ml.param") maxMemoryInMB() Maximum memory in MB allocated to histogram aggregation. If too small, then 1 node will be split per iteration, and its aggregates may exceed this size. (default = 256 MB) Returns: (undocumented) * #### minInfoGain [DoubleParam](../../../../../org/apache/spark/ml/param/DoubleParam.html "class in org.apache.spark.ml.param") minInfoGain() Minimum information gain for a split to be considered at a tree node. Should be at least 0.0\. (default = 0.0) Returns: (undocumented) * #### minInstancesPerNode [IntParam](../../../../../org/apache/spark/ml/param/IntParam.html "class in org.apache.spark.ml.param") minInstancesPerNode() Minimum number of instances each child must have after split. If a split causes the left or right child to have fewer than minInstancesPerNode, the split will be discarded as invalid. Must be at least 1\. (default = 1) Returns: (undocumented) * #### minWeightFractionPerNode [DoubleParam](../../../../../org/apache/spark/ml/param/DoubleParam.html "class in org.apache.spark.ml.param") minWeightFractionPerNode() Minimum fraction of the weighted sample count that each child must have after split. If a split causes the fraction of the total weight in the left or right child to be less than minWeightFractionPerNode, the split will be discarded as invalid. Should be in the interval \[0.0, 0.5). (default = 0.0) Returns: (undocumented) * #### setLeafCol [DecisionTreeParams](../../../../../org/apache/spark/ml/tree/DecisionTreeParams.html "interface in org.apache.spark.ml.tree") setLeafCol(String value)