Interface DecisionTreeModel

All Known Implementing Classes:
DecisionTreeClassificationModel, DecisionTreeRegressionModel

public interface DecisionTreeModel
Abstraction for Decision Tree models.
  • Method Details

    • depth

      int 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)
    • getLeafField

      StructField getLeafField(String leafCol)
    • leafAttr

      NominalAttribute leafAttr()
    • leafIterator

      scala.collection.Iterator<LeafNode> leafIterator(Node node)
      Parameters:
      node - (undocumented)
      Returns:
      an iterator that traverses (DFS, left to right) the leaves in the subtree of this node.
    • maxSplitFeatureIndex

      int 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).
    • numLeave

      int numLeave()
    • numNodes

      int numNodes()
      Number of nodes in tree, including leaf nodes.
    • predictLeaf

      double predictLeaf(Vector features)
      Parameters:
      features - (undocumented)
      Returns:
      The index of the leaf corresponding to the feature vector. Leaves are indexed in pre-order from 0.
    • rootNode

      Node rootNode()
      Root of the decision tree
    • toDebugString

      String toDebugString()
      Full description of model
    • toOld

      Convert to spark.mllib DecisionTreeModel (losing some information)
    • toString

      String toString()
      Summary of the model
      Overrides:
      toString in class Object