org.apache.ignite.ml.tree.randomforest.data

## Class TreeRoot

- java.lang.Object
- - org.apache.ignite.ml.tree.randomforest.data.TreeRoot

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

      public class TreeRoot
      extends Object
      implements IgniteModel<Vector,Double>

  Tree root class.
  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `TreeRoot(TreeNode root, Set<Integer> usedFeatures)` Create an instance of TreeRoot.

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `List<TreeNode>` | `getLeafs()`
    `TreeNode` | `getRootNode()`
    `Set<Integer>` | `getUsedFeatures()`
    `Double` | `predict(Vector vector)` Make a prediction for the specified input arguments.
    `static String` | `printTree(TreeNode node, boolean pretty)` Represents DecisionTree as String.
    `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

    - #### TreeRoot

          public TreeRoot(TreeNode root,
                          Set<Integer> usedFeatures)

      Create an instance of TreeRoot.
      Parameters:
        `root` - Root.
        `usedFeatures` - Used features.

  - ### Method Detail

    - #### predict

          public Double predict(Vector vector)

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

    - #### getUsedFeatures

          public Set<Integer> getUsedFeatures()

    - #### getRootNode

          public TreeNode getRootNode()

    - #### getLeafs

          public List<TreeNode> getLeafs()

      Returns:
        All leafs in tree.

    - #### printTree

          public static String printTree(TreeNode node,
                                         boolean pretty)

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

    - #### toString

          public String toString(boolean pretty)

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

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

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