public class RegressionTree extends Object implements Regression<double[]>
Classification and Regression Tree techniques have a number of advantages over many of those alternative techniques.
Some techniques such as bagging, boosting, and random forest use more than one decision tree for their analysis.
GradientTreeBoost
,
RandomForest
Modifier and Type | Class and Description |
---|---|
static interface |
RegressionTree.NodeOutput
An interface to calculate node output.
|
static class |
RegressionTree.Trainer
Trainer for regression tree.
|
Constructor and Description |
---|
RegressionTree(Attribute[] attributes,
double[][] x,
double[] y,
int J)
Constructor.
|
RegressionTree(Attribute[] attributes,
double[][] x,
double[] y,
int J,
int[][] order,
int[] samples,
RegressionTree.NodeOutput output)
Constructor.
|
RegressionTree(double[][] x,
double[] y,
int J)
Constructor.
|
RegressionTree(int numFeatures,
int[][] x,
double[] y,
int J)
Constructor.
|
RegressionTree(int numFeatures,
int[][] x,
double[] y,
int J,
int[] samples,
RegressionTree.NodeOutput output)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
double[] |
importance()
Returns the variable importance.
|
double |
predict(double[] x)
Predicts the dependent variable of an instance.
|
double |
predict(int[] x)
Predicts the dependent variable of an instance with sparse binary features.
|
public RegressionTree(double[][] x, double[] y, int J)
x
- the training instances.y
- the response variable.J
- the maximum number of leaf nodes in the tree.public RegressionTree(Attribute[] attributes, double[][] x, double[] y, int J)
attributes
- the attribute properties.x
- the training instances.y
- the response variable.J
- the maximum number of leaf nodes in the tree.public RegressionTree(Attribute[] attributes, double[][] x, double[] y, int J, int[][] order, int[] samples, RegressionTree.NodeOutput output)
attributes
- the attribute properties.x
- the training instances.y
- the response variable.order
- the index of training values in ascending order. Note
that only numeric attributes need be sorted.J
- the maximum number of leaf nodes in the tree.samples
- the sample set of instances for stochastic learning.
samples[i] should be 0 or 1 to indicate if the instance is used for training.public RegressionTree(int numFeatures, int[][] x, double[] y, int J)
numFeatures
- the number of sparse binary features.x
- the training instances of sparse binary features.y
- the response variable.J
- the maximum number of leaf nodes in the tree.public RegressionTree(int numFeatures, int[][] x, double[] y, int J, int[] samples, RegressionTree.NodeOutput output)
numFeatures
- the number of sparse binary features.x
- the training instances.y
- the response variable.J
- the maximum number of leaf nodes in the tree.samples
- the sample set of instances for stochastic learning.
samples[i] should be 0 or 1 to indicate if the instance is used for training.public double[] importance()
public double predict(double[] x)
Regression
predict
in interface Regression<double[]>
x
- the instance.public double predict(int[] x)
x
- the instance.Copyright © 2015. All rights reserved.