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

## Class GiniImpurityMeasure

- java.lang.Object
- - org.apache.ignite.ml.tree.impurity.gini.GiniImpurityMeasure

- All Implemented Interfaces:
    Serializable, Comparable<GiniImpurityMeasure>, ImpurityMeasure<GiniImpurityMeasure>

      public class GiniImpurityMeasure
      extends Object
      implements ImpurityMeasure<GiniImpurityMeasure>

  Gini impurity measure which is calculated the following way: `\-frac{1}{L}\sum_{i=1}^{s}l_i^2 - \frac{1}{R}\sum_{i=s+1}^{n}r_i^2`.
  See Also:
    Serialized Form

- - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `GiniImpurityMeasure` | `add(GiniImpurityMeasure b)` Adds the given impurity to this.
    `long[]` | `getLeft()`
    `long[]` | `getRight()`
    `double` | `impurity()` Calculates impurity measure as a single double value.
    `GiniImpurityMeasure` | `subtract(GiniImpurityMeasure b)` Subtracts the given impurity for this.

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

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

    - ### Methods inherited from interface org.apache.ignite.ml.tree.impurity.ImpurityMeasure

      `compareTo`

- - ### Method Detail

    - #### impurity

          public double impurity()

      Calculates impurity measure as a single double value.
      Specified by:
        `impurity` in interface `ImpurityMeasure<GiniImpurityMeasure>`
      Returns:
        Impurity measure value.

    - #### add

          public GiniImpurityMeasure add(GiniImpurityMeasure b)

      Adds the given impurity to this.
      Specified by:
        `add` in interface `ImpurityMeasure<GiniImpurityMeasure>`
      Parameters:
        `b` - Another impurity.
      Returns:
        Sum of this and the given impurity.

    - #### subtract

          public GiniImpurityMeasure subtract(GiniImpurityMeasure b)

      Subtracts the given impurity for this.
      Specified by:
        `subtract` in interface `ImpurityMeasure<GiniImpurityMeasure>`
      Parameters:
        `b` - Another impurity.
      Returns:
        Difference of this and the given impurity.

    - #### getLeft

          public long[] getLeft()

    - #### getRight

          public long[] getRight()

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