org.apache.ignite.ml.tree.impurity.gini

## Class GiniImpurityMeasureCalculator

- java.lang.Object
- - org.apache.ignite.ml.tree.impurity.ImpurityMeasureCalculator<GiniImpurityMeasure>
  - - org.apache.ignite.ml.tree.impurity.gini.GiniImpurityMeasureCalculator

- All Implemented Interfaces:
    Serializable

      public class GiniImpurityMeasureCalculator
      extends ImpurityMeasureCalculator<GiniImpurityMeasure>

  Gini impurity measure calculator.
  See Also:
    Serialized Form

- - ### Field Summary

    - ### Fields inherited from class org.apache.ignite.ml.tree.impurity.ImpurityMeasureCalculator

      `useIdx`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `GiniImpurityMeasureCalculator(Map<Double,Integer> lbEncoder, boolean useIdx)` Constructs a new instance of Gini impurity measure calculator.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `StepFunction<GiniImpurityMeasure>[]` | `calculate(DecisionTreeData data, TreeFilter filter, int depth)` Calculates all impurity measures required required to find a best split and returns them as an array of `StepFunction` (for every column).

    - ### Methods inherited from class org.apache.ignite.ml.tree.impurity.ImpurityMeasureCalculator

      `columnsCount, getFeatureValue, getFeatureValues, getLabelValue, rowsCount`

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

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

- - ### Constructor Detail

    - #### GiniImpurityMeasureCalculator

          public GiniImpurityMeasureCalculator(Map<Double,Integer> lbEncoder,
                                               boolean useIdx)

      Constructs a new instance of Gini impurity measure calculator.
      Parameters:
        `lbEncoder` - Label encoder which defines integer value for every label class.
        `useIdx` - Use index while calculate.

  - ### Method Detail

    - #### calculate

          public StepFunction<GiniImpurityMeasure>[] calculate(DecisionTreeData data,
                                                               TreeFilter filter,
                                                               int depth)

      Calculates all impurity measures required required to find a best split and returns them as an array of `StepFunction` (for every column).
      Specified by:
        `calculate` in class `ImpurityMeasureCalculator<GiniImpurityMeasure>`
      Parameters:
        `data` - Features and labels.
      Returns:
        Impurity measures as an array of `StepFunction` (for every column).

2022 Copyright © Apache Software Foundation
| Follow @ApacheIgnite
Ignite Database and Caching Platform | : ver. 2.13.0
Release Date | : April 20 2022