Package org.apache.spark.ml.tree
Interface DecisionTreeModel
- All Known Implementing Classes:
- DecisionTreeClassificationModel,- DecisionTreeRegressionModel
public interface DecisionTreeModel
Abstraction for Decision Tree models.
- 
Method SummaryModifier and TypeMethodDescriptionintdepth()Depth of the tree.longgetLeafField(String leafCol) leafAttr()scala.collection.Iterator<LeafNode>leafIterator(Node node) intTrace down the tree, and return the largest feature index used in any split.intnumLeave()intnumNodes()Number of nodes in tree, including leaf nodes.doublepredictLeaf(Vector features) rootNode()Root of the decision treeFull description of modeltoOld()Convert to spark.mllib DecisionTreeModel (losing some information)toString()Summary of the model
- 
Method Details- 
depthint depth()Depth of the tree. E.g.: Depth 0 means 1 leaf node. Depth 1 means 1 internal node and 2 leaf nodes.- Returns:
- (undocumented)
 
- 
getEstimatedSizelong getEstimatedSize()
- 
getLeafField
- 
leafAttrNominalAttribute leafAttr()
- 
leafIterator- Parameters:
- node- (undocumented)
- Returns:
- an iterator that traverses (DFS, left to right) the leaves in the subtree of this node.
 
- 
maxSplitFeatureIndexint maxSplitFeatureIndex()Trace down the tree, and return the largest feature index used in any split.- Returns:
- Max feature index used in a split, or -1 if there are no splits (single leaf node).
 
- 
numLeaveint numLeave()
- 
numNodesint numNodes()Number of nodes in tree, including leaf nodes.
- 
predictLeaf- Parameters:
- features- (undocumented)
- Returns:
- The index of the leaf corresponding to the feature vector. Leaves are indexed in pre-order from 0.
 
- 
rootNodeNode rootNode()Root of the decision tree
- 
toDebugStringString toDebugString()Full description of model
- 
toOldDecisionTreeModel toOld()Convert to spark.mllib DecisionTreeModel (losing some information)
- 
toStringString toString()Summary of the model
 
-