public final class DecisionTree extends Object implements TreeBasedClassifier
Example
s, builds a model by randomly choosing
subsets of features and the training set, and then finding a binary
Decision
over those features and data
that produces the largest information gain in the two subsets it implies. This is repeated to build a tree
of DecisionNode
s. At the bottom, leaf nodes are formed (TerminalNode
) that contain a
Prediction
of the target value.DecisionForest
,
Serialized FormConstructor and Description |
---|
DecisionTree(TreeNode root) |
Modifier and Type | Method and Description |
---|---|
TreeNode |
findByID(String id) |
TerminalNode |
findTerminal(Example example) |
Prediction |
predict(Example test) |
String |
toString() |
void |
update(Example train)
Requests that the implementation update its internal state to reflect a new
Example . |
public DecisionTree(TreeNode root)
public Prediction predict(Example test)
predict
in interface TreeBasedClassifier
test
- example whose target value is to be predicatedPrediction
of the target valuepublic TerminalNode findTerminal(Example example)
public void update(Example train)
TreeBasedClassifier
Example
.
In this case, the Example
should carry a target value to learn from.update
in interface TreeBasedClassifier
train
- new training exampleCopyright © 2014–2018. All rights reserved.