org.apache.ignite.ml.tree

## Class DecisionTree<T extends ImpurityMeasure<T>>

- java.lang.Object
- - org.apache.ignite.ml.trainers.DatasetTrainer<M,Double>
  - - org.apache.ignite.ml.trainers.SingleLabelDatasetTrainer<DecisionTreeNode>
    - - org.apache.ignite.ml.tree.DecisionTree<T>

- Type Parameters:
    `T` - Type of impurity measure.
  Direct Known Subclasses:
    DecisionTreeClassificationTrainer, DecisionTreeRegressionTrainer

      public abstract class DecisionTree<T extends ImpurityMeasure<T>>
      extends SingleLabelDatasetTrainer<DecisionTreeNode>

  Distributed decision tree trainer that allows to fit trees using row-partitioned dataset.

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class org.apache.ignite.ml.trainers.DatasetTrainer

      `DatasetTrainer.EmptyDatasetException`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected boolean` | `usingIdx` Use index structure instead of using sorting while learning.

    - ### Fields inherited from class org.apache.ignite.ml.trainers.DatasetTrainer

      `envBuilder, environment`

  - ### Method Summary

    All Methods Static Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `<K,V> DecisionTreeNode` | `fit(Dataset<EmptyContext,DecisionTreeData> dataset)`
    `<K,V> DecisionTreeNode` | `fitWithInitializedDeployingContext(DatasetBuilder<K,V> datasetBuilder, Preprocessor<K,V> preprocessor)` Trains model based on the specified data.
    `protected abstract ImpurityMeasureCalculator<T>` | `getImpurityMeasureCalculator(Dataset<EmptyContext,DecisionTreeData> dataset)` Returns impurity measure calculator.
    `boolean` | `isUpdateable(DecisionTreeNode mdl)`
    `static String` | `printTree(DecisionTreeNode node, boolean pretty)` Represents DecisionTree as String.
    `protected <K,V> DecisionTreeNode` | `updateModel(DecisionTreeNode mdl, DatasetBuilder<K,V> datasetBuilder, Preprocessor<K,V> preprocessor)` Trains new model based on dataset because there is no valid approach to update decision trees.
    `DecisionTree<T>` | `withEnvironmentBuilder(LearningEnvironmentBuilder envBuilder)` Changes learning Environment.

    - ### Methods inherited from class org.apache.ignite.ml.trainers.DatasetTrainer

      `fit, fit, fit, fit, fit, fit, getLastTrainedModelOrThrowEmptyDatasetException, identityTrainer, learningEnvironment, update, update, update, update, update, withConvertedLabels`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### usingIdx

          protected boolean usingIdx

      Use index structure instead of using sorting while learning.

  - ### Method Detail

    - #### fitWithInitializedDeployingContext

          public <K,V> DecisionTreeNode fitWithInitializedDeployingContext(DatasetBuilder<K,V> datasetBuilder,
                                                                           Preprocessor<K,V> preprocessor)

      Trains model based on the specified data.
      Specified by:
        `fitWithInitializedDeployingContext` in class `DatasetTrainer<DecisionTreeNode,Double>`
      Type Parameters:
        `K` - Type of a key in `upstream` data.
        `V` - Type of a value in `upstream` data.
      Parameters:
        `datasetBuilder` - Dataset builder.
        `preprocessor` - Extractor of `UpstreamEntry` into `LabeledVector`.
      Returns:
        Model.

    - #### isUpdateable

          public boolean isUpdateable(DecisionTreeNode mdl)

      Specified by:
        `isUpdateable` in class `DatasetTrainer<DecisionTreeNode,Double>`
      Parameters:
        `mdl` - Model.
      Returns:
        True if current critical for training parameters correspond to parameters from last training.

    - #### withEnvironmentBuilder

          public DecisionTree<T> withEnvironmentBuilder(LearningEnvironmentBuilder envBuilder)

      Changes learning Environment.
      Overrides:
        `withEnvironmentBuilder` in class `DatasetTrainer<DecisionTreeNode,Double>`
      Parameters:
        `envBuilder` - Learning environment builder.

    - #### updateModel

          protected <K,V> DecisionTreeNode updateModel(DecisionTreeNode mdl,
                                                       DatasetBuilder<K,V> datasetBuilder,
                                                       Preprocessor<K,V> preprocessor)

      Trains new model based on dataset because there is no valid approach to update decision trees.
      Specified by:
        `updateModel` in class `DatasetTrainer<DecisionTreeNode,Double>`
      Type Parameters:
        `K` - Type of a key in `upstream` data.
        `V` - Type of a value in `upstream` data.
      Parameters:
        `mdl` - Learned model.
        `datasetBuilder` - Dataset builder.
        `preprocessor` - Mapper from upstream entry to `LabeledVector`.
      Returns:
        New model based on new dataset.

    - #### fit

          public <K,V> DecisionTreeNode fit(Dataset<EmptyContext,DecisionTreeData> dataset)

    - #### printTree

          public static String printTree(DecisionTreeNode node,
                                         boolean pretty)

      Represents DecisionTree as String.
      Parameters:
        `node` - Decision tree.
        `pretty` - Use pretty mode.

    - #### getImpurityMeasureCalculator

          protected abstract ImpurityMeasureCalculator<T> getImpurityMeasureCalculator(Dataset<EmptyContext,DecisionTreeData> dataset)

      Returns impurity measure calculator.
      Parameters:
        `dataset` - Dataset.
      Returns:
        Impurity measure calculator.

2020 Copyright © Apache Software Foundation
| Follow @ApacheIgnite
Ignite Database and Caching Platform | : ver. 2.9.1
Release Date | : December 9 2020