public class CART
extends java.lang.Object
Constructor and Description |
---|
CART(DoubleTransposedDataSet dataset)
Default constructor
|
CART(DoubleTransposedDataSet dataset,
IImpurityFunction impurityFunction)
Constructor with impurity function
|
Modifier and Type | Method and Description |
---|---|
void |
build_tree()
Constructs decision tree
|
byte[][] |
getClassificationResults(DoubleTransposedDataSet dataset)
It gets the classification results
|
IImpurityFunction |
getImpurityFunction()
It returns the impurity function
|
int |
getMaxDepth()
It returns the maximal depth
|
double[] |
getRegressionResults(DoubleTransposedDataSet dataset)
It gets the regression results
|
DecisionTree |
getTree()
It returns the decision tree
|
boolean |
isRegression()
Returns if we are dealing with a regression problem
|
void |
prune_tree()
Prune decision tree
|
void |
setImpurityFunction(IImpurityFunction impurityFunction)
It sets the impurity function
|
void |
setMaxDepth(int maxDepth)
It sets the maximal depth
|
void |
setRegression(boolean regression)
It sets if we are dealing with a regression problem
|
boolean |
stopCriteria(TreeNode node)
It checks if the stop criteria has been reached
|
public CART(DoubleTransposedDataSet dataset)
dataset
- Dataset to learnpublic CART(DoubleTransposedDataSet dataset, IImpurityFunction impurityFunction)
dataset
- Dataset to learnimpurityFunction
- the impurity functionpublic DecisionTree getTree()
public IImpurityFunction getImpurityFunction()
public void setImpurityFunction(IImpurityFunction impurityFunction)
impurityFunction
- the impurityFunction to setpublic int getMaxDepth()
public void setMaxDepth(int maxDepth)
maxDepth
- the maxDepth to setpublic boolean isRegression()
public void setRegression(boolean regression)
regression
- the regression to setpublic void build_tree()
public void prune_tree()
public boolean stopCriteria(TreeNode node)
node
- Node to be checkedpublic byte[][] getClassificationResults(DoubleTransposedDataSet dataset)
dataset
- used for checking error inpublic double[] getRegressionResults(DoubleTransposedDataSet dataset)
dataset
- used for checking error in