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

## Class ClassifierLeafValuesComputer

- java.lang.Object
- - org.apache.ignite.ml.tree.randomforest.data.statistics.LeafValuesComputer<ObjectHistogram<BootstrappedVector>>
  - - org.apache.ignite.ml.tree.randomforest.data.statistics.ClassifierLeafValuesComputer

- All Implemented Interfaces:
    Serializable

      public class ClassifierLeafValuesComputer
      extends LeafValuesComputer<ObjectHistogram<BootstrappedVector>>

  Implementation of `LeafValuesComputer` for classification task.
  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `ClassifierLeafValuesComputer(Map<Double,Integer> lblMapping)` Creates an instance of ClassifierLeafValuesComputer.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected void` | `addElementToLeafStatistic(ObjectHistogram<BootstrappedVector> leafStatAggr, BootstrappedVector vec, int sampleId)` Save vector to leaf statistic.
    `protected double` | `computeLeafValue(ObjectHistogram<BootstrappedVector> stat)` Returns the most frequent value in according to statistic.
    `protected ObjectHistogram<BootstrappedVector>` | `createLeafStatsAggregator(int sampleId)` Creates an instance of leaf statistics aggregator in according to concrete algorithm based on RandomForest.
    `protected ObjectHistogram<BootstrappedVector>` | `mergeLeafStats(ObjectHistogram<BootstrappedVector> leftStats, ObjectHistogram<BootstrappedVector> rightStats)` Merge statistics for same leafs.

    - ### Methods inherited from class org.apache.ignite.ml.tree.randomforest.data.statistics.LeafValuesComputer

      `setValuesForLeaves`

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

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

- - ### Constructor Detail

    - #### ClassifierLeafValuesComputer

          public ClassifierLeafValuesComputer(Map<Double,Integer> lblMapping)

      Creates an instance of ClassifierLeafValuesComputer.
      Parameters:
        `lblMapping` - Label mapping.

  - ### Method Detail

    - #### addElementToLeafStatistic

          protected void addElementToLeafStatistic(ObjectHistogram<BootstrappedVector> leafStatAggr,
                                                   BootstrappedVector vec,
                                                   int sampleId)

      Save vector to leaf statistic.
      Specified by:
        `addElementToLeafStatistic` in class `LeafValuesComputer<ObjectHistogram<BootstrappedVector>>`
      Parameters:
        `leafStatAggr` - Leaf statistics aggregator.
        `vec` - Vector.
        `sampleId` - Sample id.

    - #### mergeLeafStats

          protected ObjectHistogram<BootstrappedVector> mergeLeafStats(ObjectHistogram<BootstrappedVector> leftStats,
                                                                       ObjectHistogram<BootstrappedVector> rightStats)

      Merge statistics for same leafs.
      Specified by:
        `mergeLeafStats` in class `LeafValuesComputer<ObjectHistogram<BootstrappedVector>>`
      Parameters:
        `leftStats` - First leaf stat aggregator.
        `rightStats` - Second leaf stat aggregator.

    - #### createLeafStatsAggregator

          protected ObjectHistogram<BootstrappedVector> createLeafStatsAggregator(int sampleId)

      Creates an instance of leaf statistics aggregator in according to concrete algorithm based on RandomForest.
      Specified by:
        `createLeafStatsAggregator` in class `LeafValuesComputer<ObjectHistogram<BootstrappedVector>>`
      Parameters:
        `sampleId` - Sample id.

    - #### computeLeafValue

          protected double computeLeafValue(ObjectHistogram<BootstrappedVector> stat)

      Returns the most frequent value in according to statistic.
      Specified by:
        `computeLeafValue` in class `LeafValuesComputer<ObjectHistogram<BootstrappedVector>>`
      Parameters:
        `stat` - Leaf statistics.

2021 Copyright © Apache Software Foundation
| Follow @ApacheIgnite
Ignite Database and Caching Platform | : ver. 2.11.0
Release Date | : September 11 2021