public class ClassifierTrainingNode extends AbstractTrainingNode<Label>
AbstractTrainingNode.LeafDeterminer
DEFAULT_SIZE, depth, greaterThan, impurityScore, leafDeterminer, lessThanOrEqual, numExamples, split, splitID, splitValue
Constructor and Description |
---|
ClassifierTrainingNode(LabelImpurity impurity,
Dataset<Label> examples,
AbstractTrainingNode.LeafDeterminer leafDeterminer)
Constructor which creates the inverted file.
|
Modifier and Type | Method and Description |
---|---|
List<AbstractTrainingNode<Label>> |
buildRandomTree(int[] featureIDs,
SplittableRandom rng)
Builds a CART tree with randomly chosen split points.
|
List<AbstractTrainingNode<Label>> |
buildTree(int[] featureIDs,
SplittableRandom rng,
boolean useRandomSplitPoints)
Builds a tree according to CART (as it does not do multi-way splits on categorical values like C4.5).
|
Node<Label> |
convertTree()
|
double |
getImpurity()
The impurity score of this node.
|
float |
getWeightSum()
The sum of the weights associated with this node's examples.
|
copy, createSplitNode, getDepth, getNextNode, getNumExamples, isLeaf, shouldMakeLeaf
public ClassifierTrainingNode(LabelImpurity impurity, Dataset<Label> examples, AbstractTrainingNode.LeafDeterminer leafDeterminer)
impurity
- The impurity function to use.examples
- The training data.leafDeterminer
- Contains parameters needed to determine whether a child node will be a leaf.public float getWeightSum()
AbstractTrainingNode
getWeightSum
in class AbstractTrainingNode<Label>
public double getImpurity()
Node
public List<AbstractTrainingNode<Label>> buildTree(int[] featureIDs, SplittableRandom rng, boolean useRandomSplitPoints)
buildTree
in class AbstractTrainingNode<Label>
featureIDs
- Indices of the features available in this split.rng
- Splittable random number generator.useRandomSplitPoints
- Whether to choose split points for features at random.public List<AbstractTrainingNode<Label>> buildRandomTree(int[] featureIDs, SplittableRandom rng)
featureIDs
- Indices of the features available in this split.rng
- Splittable random number generator.public Node<Label> convertTree()
convertTree
in class AbstractTrainingNode<Label>
Copyright © 2015–2021 Oracle and/or its affiliates. All rights reserved.