Class NominalSplit

java.lang.Object
smile.base.cart.Split
smile.base.cart.NominalSplit

public class NominalSplit extends Split
The data about of a potential split for a leaf node.
  • Constructor Details

    • NominalSplit

      public NominalSplit(LeafNode leaf, int feature, int value, double score, int lo, int hi, int trueCount, int falseCount, IntPredicate predicate)
      Constructor.
      Parameters:
      leaf - the node to split.
      feature - the index of feature column.
      value - the split value.
      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.
      predicate - the lambda returns true if the sample passes the test on the split feature.
  • Method Details

    • toNode

      public NominalNode toNode(Node trueChild, Node falseChild)
      Description copied from class: Split
      Returns an internal node with the feature, value, and score of this split.
      Specified by:
      toNode in class Split
      Parameters:
      trueChild - the child node of true branch.
      falseChild - the child node of false branch.
      Returns:
      an internal node
    • predicate

      public IntPredicate predicate()
      Description copied from class: Split
      Returns the lambda that tests on the split feature.
      Specified by:
      predicate in class Split
      Returns:
      the lambda that tests on the split feature.