Package ciir.umass.edu.learning.tree
Class RegressionTree
- java.lang.Object
-
- ciir.umass.edu.learning.tree.RegressionTree
-
public class RegressionTree extends java.lang.Object- Author:
- vdang
-
-
Field Summary
Fields Modifier and Type Field Description protected int[]featuresprotected FeatureHistogramhistprotected int[]indexprotected java.util.List<Split>leavesprotected intminLeafSupportprotected intnodesprotected Splitrootprotected float[][]thresholdsprotected double[]trainingLabelsprotected DataPoint[]trainingSamples
-
Constructor Summary
Constructors Constructor Description RegressionTree(int nLeaves, DataPoint[] trainingSamples, double[] labels, FeatureHistogram hist, int minLeafSupport)RegressionTree(Split root)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclearSamples()Clear samples associated with each leaves (when they are no longer necessary) in order to save memorydoubleeval(DataPoint dp)Get the tree output for the input samplevoidfit()Fit the tree from the specified training dataprotected voidinsert(java.util.List<Split> ls, Split s)java.util.List<Split>leaves()Retrieve all leave nodes in the treejava.lang.StringtoString()Generate the string representation of the treejava.lang.StringtoString(java.lang.String indent)doublevariance()
-
-
-
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
-
hist
protected FeatureHistogram hist
-
-
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:
toStringin classjava.lang.Object
-
toString
public java.lang.String toString(java.lang.String indent)
-
variance
public double variance()
-
-