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

## Class ClassificationMetricsAggregator<L extends Serializable>

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

- Type Parameters:
    `L` - Type of label.
  All Implemented Interfaces:
    Serializable, MetricStatsAggregator<L,EmptyContext<L>,ClassificationMetricsAggregator<L>>

      public class ClassificationMetricsAggregator<L extends Serializable>
      extends Object
      implements MetricStatsAggregator<L,EmptyContext<L>,ClassificationMetricsAggregator<L>>

  Class represents aggregations for classification metric (including multi-classification case).
  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `ClassificationMetricsAggregator()` Creates an instance of ClassificationMetricsAggregator.
    `ClassificationMetricsAggregator(long validAnswersCnt, long totalNumOfExamples)` Creates an instance of ClassificationMetricsAggregator.

  - ### 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.
    `EmptyContext<L>` | `createInitializedContext()` Returns initialized context.
    `long` | `getTotalNumberOfExamples()` Returns totalNumberOfExamples.
    `long` | `getValidAnswersCount()` Returns validAnswersCount.
    `void` | `initByContext(EmptyContext<L> ctx)` Inits this aggtegator by evaluation context.
    `ClassificationMetricsAggregator<L>` | `mergeWith(ClassificationMetricsAggregator<L> 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

    - #### ClassificationMetricsAggregator

          public ClassificationMetricsAggregator()

      Creates an instance of ClassificationMetricsAggregator.

    - #### ClassificationMetricsAggregator

          public ClassificationMetricsAggregator(long validAnswersCnt,
                                                 long totalNumOfExamples)

      Creates an instance of ClassificationMetricsAggregator.
      Parameters:
        `validAnswersCnt` - Valid answers count.
        `totalNumOfExamples` - Total number of examples.

  - ### 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,EmptyContext<L extends Serializable>,ClassificationMetricsAggregator<L extends Serializable>>`
      Parameters:
        `mdl` - Model.
        `vector` - Vector.

    - #### mergeWith

          public ClassificationMetricsAggregator<L> mergeWith(ClassificationMetricsAggregator<L> other)

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

    - #### createInitializedContext

          public EmptyContext<L> createInitializedContext()

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

    - #### initByContext

          public void initByContext(EmptyContext<L> ctx)

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

    - #### getValidAnswersCount

          public long getValidAnswersCount()

      Returns validAnswersCount.
      Returns:
        validAnswersCount.

    - #### getTotalNumberOfExamples

          public long getTotalNumberOfExamples()

      Returns totalNumberOfExamples.
      Returns:
        totalNumberOfExamples.

2020 Copyright © Apache Software Foundation
| Follow @ApacheIgnite
Ignite Database and Caching Platform | : ver. 2.9.0
Release Date | : October 15 2020