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

## Class ImpurityHistogramsComputer<S extends ImpurityComputer<BootstrappedVector,S>>

- java.lang.Object
- - org.apache.ignite.ml.tree.randomforest.data.impurity.ImpurityHistogramsComputer<S>

- Type Parameters:
    `S` - Type of basic impurity computer for feature.
  All Implemented Interfaces:
    Serializable
  Direct Known Subclasses:
    GiniHistogramsComputer, MSEHistogramComputer

      public abstract class ImpurityHistogramsComputer<S extends ImpurityComputer<BootstrappedVector,S>>
      extends Object
      implements Serializable

  Class containing logic of aggregation impurity statistics within learning dataset.
  See Also:
    Serialized Form

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `ImpurityHistogramsComputer.NodeImpurityHistograms<S extends ImpurityComputer<BootstrappedVector,S>>` Class represents per feature statistics for impurity computing.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ImpurityHistogramsComputer()`

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `Map<NodeId,ImpurityHistogramsComputer.NodeImpurityHistograms<S>>` | `aggregateImpurityStatistics(ArrayList<RandomForestTreeModel> roots, Map<Integer,BucketMeta> histMeta, Map<NodeId,TreeNode> nodesToLearn, Dataset<EmptyContext,BootstrappedDatasetPartition> dataset)` Computes histograms for each feature.
    `protected abstract S` | `createImpurityComputerForFeature(int sampleId, BucketMeta meta)` Creates impurity computer in according to specific algorithm based on random forest (for example `GiniHistogram` for classification).

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

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

- - ### Constructor Detail

    - #### ImpurityHistogramsComputer

          public ImpurityHistogramsComputer()

  - ### Method Detail

    - #### aggregateImpurityStatistics

          public Map<NodeId,ImpurityHistogramsComputer.NodeImpurityHistograms<S>> aggregateImpurityStatistics(ArrayList<RandomForestTreeModel> roots,
                                                                                                              Map<Integer,BucketMeta> histMeta,
                                                                                                              Map<NodeId,TreeNode> nodesToLearn,
                                                                                                              Dataset<EmptyContext,BootstrappedDatasetPartition> dataset)

      Computes histograms for each feature.
      Parameters:
        `roots` - Random forest roots.
        `histMeta` - Histograms meta.
        `nodesToLearn` - Nodes to learn.
        `dataset` - Dataset.

    - #### createImpurityComputerForFeature

          protected abstract S createImpurityComputerForFeature(int sampleId,
                                                                BucketMeta meta)

      Creates impurity computer in according to specific algorithm based on random forest (for example `GiniHistogram` for classification).
      Parameters:
        `sampleId` - Sample id.
        `meta` - Bucket Meta.
      Returns:
        Impurity computer

2021 Copyright © Apache Software Foundation
| Follow @ApacheIgnite
Ignite Database and Caching Platform | : ver. 2.10.0
Release Date | : March 10 2021