org.apache.ignite.ml.tree

## Class DecisionTreeModel

- java.lang.Object
- - org.apache.ignite.ml.tree.DecisionTreeModel

- All Implemented Interfaces:
    Serializable, AutoCloseable, IgniteModel<Vector,Double>, JSONWritable, Model<Vector,Double>

      public class DecisionTreeModel
      extends Object
      implements IgniteModel<Vector,Double>, JSONWritable

  Base class for decision tree models.
  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `DecisionTreeModel(DecisionTreeNode rootNode)` Creates the model.

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static DecisionTreeModel` | `fromJSON(Path path)` Loads DecisionTreeModel from JSON file.
    `DecisionTreeNode` | `getRootNode()` Returns the root node.
    `Double` | `predict(Vector features)` Make a prediction for the specified input arguments.
    `void` | `toJSON(Path path)`
    `String` | `toString()`
    `String` | `toString(boolean pretty)`

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

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

    - ### Methods inherited from interface org.apache.ignite.ml.IgniteModel

      `andBefore, andThen, andThen, close, combine`

- - ### Constructor Detail

    - #### DecisionTreeModel

          public DecisionTreeModel(DecisionTreeNode rootNode)

      Creates the model.
      Parameters:
        `rootNode` - Root node of the tree.

  - ### Method Detail

    - #### getRootNode

          public DecisionTreeNode getRootNode()

      Returns the root node.

    - #### predict

          public Double predict(Vector features)

      Make a prediction for the specified input arguments.
      Specified by:
        `predict` in interface `Model<Vector,Double>`
      Parameters:
        `features` - Input arguments.
      Returns:
        Prediction result.

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

    - #### toString

          public String toString(boolean pretty)

      Specified by:
        `toString` in interface `IgniteModel<Vector,Double>`
      Parameters:
        `pretty` - Use pretty mode.

    - #### toJSON

          public void toJSON(Path path)

      Specified by:
        `toJSON` in interface `JSONWritable`

    - #### fromJSON

          public static DecisionTreeModel fromJSON(Path path)

      Loads DecisionTreeModel from JSON file.

${current.year} Copyright © Apache Software Foundation
| Follow @ApacheIgnite
Ignite Database and Caching Platform | : ver. 2.15.0
Release Date | : April 25 2023