Class RegressionTree


  • public class RegressionTree
    extends java.lang.Object
    Author:
    vdang
    • Field Detail

      • nodes

        protected int nodes
      • minLeafSupport

        protected int minLeafSupport
      • root

        protected Split root
      • leaves

        protected java.util.List<Split> leaves
      • trainingSamples

        protected DataPoint[] trainingSamples
      • trainingLabels

        protected double[] trainingLabels
      • features

        protected int[] features
      • thresholds

        protected float[][] thresholds
      • index

        protected int[] index
    • Constructor Detail

      • RegressionTree

        public RegressionTree​(Split root)
      • RegressionTree

        public RegressionTree​(int nLeaves,
                              DataPoint[] trainingSamples,
                              double[] labels,
                              FeatureHistogram hist,
                              int minLeafSupport)
    • Method Detail

      • fit

        public void fit()
        Fit the tree from the specified training data
      • eval

        public double eval​(DataPoint dp)
        Get the tree output for the input sample
        Parameters:
        dp -
        Returns:
      • leaves

        public java.util.List<Split> leaves()
        Retrieve all leave nodes in the tree
        Returns:
      • clearSamples

        public void clearSamples()
        Clear samples associated with each leaves (when they are no longer necessary) in order to save memory
      • toString

        public java.lang.String toString()
        Generate the string representation of the tree
        Overrides:
        toString in class java.lang.Object
      • toString

        public java.lang.String toString​(java.lang.String indent)
      • variance

        public double variance()
      • insert

        protected void insert​(java.util.List<Split> ls,
                              Split s)