org.apache.ignite.ml.selection.scoring.evaluator.aggregator

## Class BinaryClassificationPointwiseMetricStatsAggregator<L extends Serializable>

- java.lang.Object
- - org.apache.ignite.ml.selection.scoring.evaluator.aggregator.BinaryClassificationPointwiseMetricStatsAggregator<L>

- All Implemented Interfaces:
    Serializable, MetricStatsAggregator<L,BinaryClassificationEvaluationContext<L>,BinaryClassificationPointwiseMetricStatsAggregator<L>>
  Direct Known Subclasses:
    BinaryClassificationPointwiseMetricStatsAggregator.WithCustomLabelsAggregator

      public class BinaryClassificationPointwiseMetricStatsAggregator<L extends Serializable>
      extends Object
      implements MetricStatsAggregator<L,BinaryClassificationEvaluationContext<L>,BinaryClassificationPointwiseMetricStatsAggregator<L>>

  This class represents statistics for pointwise metrics evaluation for binary classification like TruePositive, FalsePositive, TrueNegative and FalseNegative.
  See Also:
    Serialized Form

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `BinaryClassificationPointwiseMetricStatsAggregator.WithCustomLabelsAggregator<L extends Serializable>` Class represents already initialized aggregator.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `BinaryClassificationPointwiseMetricStatsAggregator()` Creates an instance of BinaryClassificationPointwiseMetricStatsAggregator.
    `BinaryClassificationPointwiseMetricStatsAggregator(L falseLabel, L truthLabel, int truePositive, int falsePositive, int trueNegative, int falseNegative)` Creates an instance of BinaryClassificationPointwiseMetricStatsAggregator.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `aggregate(IgniteModel<Vector,L> mdl, LabeledVector<L> vector)` Aggregates statistics for metric computation given model and vector with answer.
    `BinaryClassificationEvaluationContext<L>` | `createInitializedContext()` Returns initialized context.
    `L` | `getFalseLabel()` Returns false label.
    `int` | `getFalseNegative()` Returns false negatives count.
    `int` | `getFalsePositive()` Returns false positives count.
    `int` | `getN()` Returns number of elements in dataset.
    `int` | `getTrueNegative()` Returns true negatives count.
    `int` | `getTruePositive()` Returns true positives count.
    `L` | `getTruthLabel()` Returns truth label.
    `void` | `initByContext(BinaryClassificationEvaluationContext<L> ctx)` Inits this aggtegator by evaluation context.
    `BinaryClassificationPointwiseMetricStatsAggregator<L>` | `mergeWith(BinaryClassificationPointwiseMetricStatsAggregator other)` Merges statistics of two aggregators to new aggreagator.

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

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

- - ### Constructor Detail

    - #### BinaryClassificationPointwiseMetricStatsAggregator

          public BinaryClassificationPointwiseMetricStatsAggregator()

      Creates an instance of BinaryClassificationPointwiseMetricStatsAggregator.

    - #### BinaryClassificationPointwiseMetricStatsAggregator

          public BinaryClassificationPointwiseMetricStatsAggregator(L falseLabel,
                                                                    L truthLabel,
                                                                    int truePositive,
                                                                    int falsePositive,
                                                                    int trueNegative,
                                                                    int falseNegative)

      Creates an instance of BinaryClassificationPointwiseMetricStatsAggregator.
      Parameters:
        `falseLabel` - False label.
        `truthLabel` - Truth label.
        `truePositive` - True positives amount.
        `falsePositive` - False positives amount.
        `trueNegative` - True negatives amount.
        `falseNegative` - False negatives amount.

  - ### Method Detail

    - #### aggregate

          public void aggregate(IgniteModel<Vector,L> mdl,
                                LabeledVector<L> vector)

      Aggregates statistics for metric computation given model and vector with answer.
      Specified by:
        `aggregate` in interface `MetricStatsAggregator<L extends Serializable,BinaryClassificationEvaluationContext<L extends Serializable>,BinaryClassificationPointwiseMetricStatsAggregator<L extends Serializable>>`
      Parameters:
        `mdl` - Model.
        `vector` - Vector.

    - #### mergeWith

          public BinaryClassificationPointwiseMetricStatsAggregator<L> mergeWith(BinaryClassificationPointwiseMetricStatsAggregator other)

      Merges statistics of two aggregators to new aggreagator.
      Specified by:
        `mergeWith` in interface `MetricStatsAggregator<L extends Serializable,BinaryClassificationEvaluationContext<L extends Serializable>,BinaryClassificationPointwiseMetricStatsAggregator<L extends Serializable>>`
      Parameters:
        `other` - Other aggregator.
      Returns:
        New aggregator.

    - #### createInitializedContext

          public BinaryClassificationEvaluationContext<L> createInitializedContext()

      Returns initialized context.
      Specified by:
        `createInitializedContext` in interface `MetricStatsAggregator<L extends Serializable,BinaryClassificationEvaluationContext<L extends Serializable>,BinaryClassificationPointwiseMetricStatsAggregator<L extends Serializable>>`
      Returns:
        initialized evaluation context.

    - #### initByContext

          public void initByContext(BinaryClassificationEvaluationContext<L> ctx)

      Inits this aggtegator by evaluation context.
      Specified by:
        `initByContext` in interface `MetricStatsAggregator<L extends Serializable,BinaryClassificationEvaluationContext<L extends Serializable>,BinaryClassificationPointwiseMetricStatsAggregator<L extends Serializable>>`
      Parameters:
        `ctx` - Evaluation context.

    - #### getFalseLabel

          public L getFalseLabel()

      Returns false label.
      Returns:
        False label.

    - #### getTruthLabel

          public L getTruthLabel()

      Returns truth label.
      Returns:
        Truth label.

    - #### getTruePositive

          public int getTruePositive()

      Returns true positives count.
      Returns:
        True positives count.

    - #### getFalsePositive

          public int getFalsePositive()

      Returns false positives count.
      Returns:
        False positives count.

    - #### getTrueNegative

          public int getTrueNegative()

      Returns true negatives count.
      Returns:
        True negatives count.

    - #### getFalseNegative

          public int getFalseNegative()

      Returns false negatives count.
      Returns:
        False negatives count.

    - #### getN

          public int getN()

      Returns number of elements in dataset.
      Returns:
        Number of elements in dataset.

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