Class Split

java.lang.Object
smile.base.cart.Split
Direct Known Subclasses:
NominalSplit, OrdinalSplit

public abstract class Split extends Object
The data about of a potential split for a leaf node.
  • Field Details

    • comparator

      public static final Comparator<Split> comparator
      The comparator on the split score.
  • Constructor Details

    • Split

      public Split(LeafNode leaf, int feature, double score, int lo, int hi, int trueCount, int falseCount)
      Constructor.
      Parameters:
      leaf - the node to split.
      feature - the index of feature column.
      score - the split score.
      lo - the lower bound of sample index in the node.
      hi - the upper bound of sample index in the node.
      trueCount - the number of samples in true branch child.
      falseCount - the number of samples false branch child.
  • Method Details

    • toNode

      public abstract InternalNode toNode(Node trueChild, Node falseChild)
      Returns an internal node with the feature, value, and score of this split.
      Parameters:
      trueChild - the child node of true branch.
      falseChild - the child node of false branch.
      Returns:
      an internal node
    • predicate

      public abstract IntPredicate predicate()
      Returns the lambda that tests on the split feature.
      Returns:
      the lambda that tests on the split feature.
    • toString

      public String toString()
      Overrides:
      toString in class Object