public class ExtraTree extends Object implements Classifier, Regressor, TreeLearner, Parameterized
Constructor and Description |
---|
ExtraTree()
Creates a new Extra Tree that will use all features in the training set
|
ExtraTree(int selectionCount,
int stopSize)
Creates a new Extra Tree
|
Modifier and Type | Method and Description |
---|---|
CategoricalResults |
classify(DataPoint data)
Performs classification on the given data point.
|
ExtraTree |
clone() |
ImpurityScore.ImpurityMeasure |
getImpurityMeasure()
Returns the impurity measure in use
|
Parameter |
getParameter(String paramName)
Returns the parameter with the given name.
|
List<Parameter> |
getParameters()
Returns the list of parameters that can be altered for this learner.
|
int |
getSelectionCount()
Returns the number of random features chosen at each level in the tree
|
int |
getStopSize()
Returns the stopping size for tree growth
|
TreeNodeVisitor |
getTreeNodeVisitor()
Obtains a node visitor for the tree learner that can be used to traverse
and predict from the learned tree
|
boolean |
isBinaryCategoricalSplitting()
Returns whether or not binary splitting is used for nominal features
|
double |
regress(DataPoint data) |
void |
setBinaryCategoricalSplitting(boolean binaryCategoricalSplitting)
The normal implementation of ExtraTree always produces binary splits,
including for categorical features.
|
void |
setImpurityMeasure(ImpurityScore.ImpurityMeasure impurityMeasure)
Sets the impurity measure used during classification tree construction to
select the best of the features.
|
void |
setSelectionCount(int selectionCount)
The ExtraTree will select the best of a random subset of features at each
level, this sets the number of random features to select.
|
void |
setStopSize(int stopSize)
Sets the stopping size for tree growth.
|
boolean |
supportsWeightedData()
Indicates whether the model knows how to train using weighted data points.
|
void |
train(RegressionDataSet dataSet) |
void |
train(RegressionDataSet dataSet,
ExecutorService threadPool) |
void |
trainC(ClassificationDataSet dataSet)
Trains the classifier and constructs a model for classification using the
given data set.
|
void |
trainC(ClassificationDataSet dataSet,
ExecutorService threadPool)
Trains the classifier and constructs a model for classification using the
given data set.
|
public ExtraTree()
public ExtraTree(int selectionCount, int stopSize)
selectionCount
- the number of features to selectstopSize
- the stop sizepublic void setImpurityMeasure(ImpurityScore.ImpurityMeasure impurityMeasure)
impurityMeasure
- the impurity measure to usepublic ImpurityScore.ImpurityMeasure getImpurityMeasure()
public void setStopSize(int stopSize)
stopSize
- the size of the testing set to refuse to splitpublic int getStopSize()
public void setSelectionCount(int selectionCount)
selectionCount
- the number of random features to selectpublic int getSelectionCount()
public void setBinaryCategoricalSplitting(boolean binaryCategoricalSplitting)
binaryCategoricalSplitting
- whether or not to use the original
splitting algorithm, or to fully expand nominal featurespublic boolean isBinaryCategoricalSplitting()
public CategoricalResults classify(DataPoint data)
Classifier
classify
in interface Classifier
data
- the data point to classifypublic void trainC(ClassificationDataSet dataSet, ExecutorService threadPool)
Classifier
trainC
in interface Classifier
dataSet
- the data set to train onthreadPool
- the source of threads to use.public void trainC(ClassificationDataSet dataSet)
Classifier
trainC
in interface Classifier
dataSet
- the data set to train onpublic boolean supportsWeightedData()
Classifier
supportsWeightedData
in interface Classifier
supportsWeightedData
in interface Regressor
public ExtraTree clone()
public TreeNodeVisitor getTreeNodeVisitor()
TreeLearner
getTreeNodeVisitor
in interface TreeLearner
public void train(RegressionDataSet dataSet, ExecutorService threadPool)
public void train(RegressionDataSet dataSet)
public List<Parameter> getParameters()
Parameterized
getParameters
in interface Parameterized
public Parameter getParameter(String paramName)
Parameterized
getParameter
in interface Parameterized
paramName
- the name of the parameter to obtainCopyright © 2017. All rights reserved.