T
- Type of impurity measure.public abstract class DecisionTree<T extends ImpurityMeasure<T>> extends DatasetTrainer<DecisionTreeNode,Double>
DatasetTrainer.EmptyDatasetException
Modifier and Type | Field and Description |
---|---|
protected boolean |
usingIdx
Use index structure instead of using sorting while learning.
|
environment
Modifier and Type | Method and Description |
---|---|
protected boolean |
checkState(DecisionTreeNode mdl) |
<K,V> DecisionTreeNode |
fit(Dataset<EmptyContext,DecisionTreeData> dataset) |
<K,V> DecisionTreeNode |
fit(DatasetBuilder<K,V> datasetBuilder,
IgniteBiFunction<K,V,Vector> featureExtractor,
IgniteBiFunction<K,V,Double> lbExtractor)
Trains model based on the specified data.
|
protected abstract ImpurityMeasureCalculator<T> |
getImpurityMeasureCalculator(Dataset<EmptyContext,DecisionTreeData> dataset)
Returns impurity measure calculator.
|
static String |
printTree(DecisionTreeNode node,
boolean pretty)
Represents DecisionTree as String.
|
<K,V> DecisionTreeNode |
updateModel(DecisionTreeNode mdl,
DatasetBuilder<K,V> datasetBuilder,
IgniteBiFunction<K,V,Vector> featureExtractor,
IgniteBiFunction<K,V,Double> lbExtractor)
Trains new model based on dataset because there is no valid approach to update decision trees.
|
fit, fit, fit, fit, getLastTrainedModelOrThrowEmptyDatasetException, setEnvironment, update, update, update, update, update
protected boolean usingIdx
public <K,V> DecisionTreeNode fit(DatasetBuilder<K,V> datasetBuilder, IgniteBiFunction<K,V,Vector> featureExtractor, IgniteBiFunction<K,V,Double> lbExtractor)
fit
in class DatasetTrainer<DecisionTreeNode,Double>
K
- Type of a key in upstream
data.V
- Type of a value in upstream
data.datasetBuilder
- Dataset builder.featureExtractor
- Feature extractor.lbExtractor
- Label extractor.public <K,V> DecisionTreeNode updateModel(DecisionTreeNode mdl, DatasetBuilder<K,V> datasetBuilder, IgniteBiFunction<K,V,Vector> featureExtractor, IgniteBiFunction<K,V,Double> lbExtractor)
updateModel
in class DatasetTrainer<DecisionTreeNode,Double>
K
- Type of a key in upstream
data.V
- Type of a value in upstream
data.mdl
- Learned model.datasetBuilder
- Dataset builder.featureExtractor
- Feature extractor.lbExtractor
- Label extractor.protected boolean checkState(DecisionTreeNode mdl)
checkState
in class DatasetTrainer<DecisionTreeNode,Double>
mdl
- Model.public <K,V> DecisionTreeNode fit(Dataset<EmptyContext,DecisionTreeData> dataset)
protected abstract ImpurityMeasureCalculator<T> getImpurityMeasureCalculator(Dataset<EmptyContext,DecisionTreeData> dataset)
dataset
- Dataset.public static String printTree(DecisionTreeNode node, boolean pretty)
node
- Decision tree.pretty
- Use pretty mode.
Follow @ApacheIgnite
Ignite Database and Caching Platform : ver. 2.7.2 Release Date : February 6 2019