Class DecisionTreeModel
Object
org.apache.spark.mllib.tree.model.DecisionTreeModel
- All Implemented Interfaces:
- Serializable,- Saveable
Decision tree model for classification or regression.
 This model stores the decision tree structure and parameters.
 param:  topNode root node
 param:  algo algorithm type -- classification or regression
- See Also:
- 
Nested Class SummaryNested Classes
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionscala.Enumeration.Valuealgo()intdepth()Get depth of tree.static DecisionTreeModelload(SparkContext sc, String path) static org.apache.spark.internal.Logging.LogStringContextLogStringContext(scala.StringContext sc) intnumNodes()Get number of nodes in tree, including leaf nodes.static org.slf4j.Loggerstatic voidorg$apache$spark$internal$Logging$$log__$eq(org.slf4j.Logger x$1) Predict values for the given data set using the model trained.doublePredict values for a single data point using the model trained.Predict values for the given data set using the model trained.voidsave(SparkContext sc, String path) Save this model to the given path.Print the full model to a string.topNode()toString()Print a summary of the model.
- 
Constructor Details- 
DecisionTreeModel
 
- 
- 
Method Details- 
load- Parameters:
- sc- Spark context used for loading model files.
- path- Path specifying the directory to which the model was saved.
- Returns:
- Model instance
 
- 
org$apache$spark$internal$Logging$$log_public static org.slf4j.Logger org$apache$spark$internal$Logging$$log_()
- 
org$apache$spark$internal$Logging$$log__$eqpublic static void org$apache$spark$internal$Logging$$log__$eq(org.slf4j.Logger x$1) 
- 
LogStringContextpublic static org.apache.spark.internal.Logging.LogStringContext LogStringContext(scala.StringContext sc) 
- 
topNode
- 
algopublic scala.Enumeration.Value algo()
- 
predictPredict values for a single data point using the model trained.- Parameters:
- features- array representing a single data point
- Returns:
- Double prediction from the trained model
 
- 
predictPredict values for the given data set using the model trained.- Parameters:
- features- RDD representing data points to be predicted
- Returns:
- RDD of predictions for each of the given data points
 
- 
predictPredict values for the given data set using the model trained.- Parameters:
- features- JavaRDD representing data points to be predicted
- Returns:
- JavaRDD of predictions for each of the given data points
 
- 
numNodespublic int numNodes()Get number of nodes in tree, including leaf nodes.- Returns:
- (undocumented)
 
- 
depthpublic int depth()Get depth of tree. E.g.: Depth 0 means 1 leaf node. Depth 1 means 1 internal node and 2 leaf nodes.- Returns:
- (undocumented)
 
- 
toStringPrint a summary of the model.
- 
toDebugStringPrint the full model to a string.- Returns:
- (undocumented)
 
- 
saveDescription copied from interface:SaveableSave this model to the given path.This saves: - human-readable (JSON) model metadata to path/metadata/ - Parquet formatted data to path/data/ The model may be loaded using Loader.load.
 
-