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

## Class RegressionMetricStatsAggregator

- java.lang.Object
- - org.apache.ignite.ml.selection.scoring.evaluator.aggregator.RegressionMetricStatsAggregator

- All Implemented Interfaces:
    Serializable, MetricStatsAggregator<Double,EmptyContext<Double>,RegressionMetricStatsAggregator>

      public class RegressionMetricStatsAggregator
      extends Object
      implements MetricStatsAggregator<Double,EmptyContext<Double>,RegressionMetricStatsAggregator>

  Class represents statistics aggregator for regression estimation.
  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `RegressionMetricStatsAggregator()` Creates an instance of RegressionMetricStatsAggregator.
    `RegressionMetricStatsAggregator(long n, double absoluteError, double rss, double sumOfYs, double sumOfSquaredYs)` Creates an instance of RegressionMetricStatsAggregator.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `aggregate(IgniteModel<Vector,Double> model, LabeledVector<Double> vector)` Aggregates statistics for metric computation given model and vector with answer.
    `EmptyContext` | `createInitializedContext()` Returns initialized context.
    `double` | `getMAE()` Returns mean absolute error.
    `double` | `getMSE()` Returns mean squared error.
    `double` | `getRss()` Returns RSS.
    `void` | `initByContext(EmptyContext context)` Inits this aggtegator by evaluation context.
    `RegressionMetricStatsAggregator` | `mergeWith(RegressionMetricStatsAggregator other)` Merges statistics of two aggregators to new aggreagator.
    `double` | `ysRss()` Returns sum of squared errors.
    `double` | `ysVariance()` Returns label variance.

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

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

- - ### Constructor Detail

    - #### RegressionMetricStatsAggregator

          public RegressionMetricStatsAggregator()

      Creates an instance of RegressionMetricStatsAggregator.

    - #### RegressionMetricStatsAggregator

          public RegressionMetricStatsAggregator(long n,
                                                 double absoluteError,
                                                 double rss,
                                                 double sumOfYs,
                                                 double sumOfSquaredYs)

      Creates an instance of RegressionMetricStatsAggregator.
      Parameters:
        `n` - Number of examples in dataset.
        `absoluteError` - Absolute error.
        `rss` - Rss.
        `sumOfYs` - Sum of labels.
        `sumOfSquaredYs` - Sum of squared labels.

  - ### Method Detail

    - #### aggregate

          public void aggregate(IgniteModel<Vector,Double> model,
                                LabeledVector<Double> vector)

      Aggregates statistics for metric computation given model and vector with answer.
      Specified by:
        `aggregate` in interface `MetricStatsAggregator<Double,EmptyContext<Double>,RegressionMetricStatsAggregator>`
      Parameters:
        `model` - Model.
        `vector` - Vector.

    - #### mergeWith

          public RegressionMetricStatsAggregator mergeWith(RegressionMetricStatsAggregator other)

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

    - #### createInitializedContext

          public EmptyContext createInitializedContext()

      Returns initialized context.
      Specified by:
        `createInitializedContext` in interface `MetricStatsAggregator<Double,EmptyContext<Double>,RegressionMetricStatsAggregator>`
      Returns:
        initialized evaluation context.

    - #### initByContext

          public void initByContext(EmptyContext context)

      Inits this aggtegator by evaluation context.
      Specified by:
        `initByContext` in interface `MetricStatsAggregator<Double,EmptyContext<Double>,RegressionMetricStatsAggregator>`
      Parameters:
        `context` - Evaluation context.

    - #### getMAE

          public double getMAE()

      Returns mean absolute error.
      Returns:
        Mean absolute error.

    - #### getMSE

          public double getMSE()

      Returns mean squared error.
      Returns:
        Mean squared error.

    - #### ysRss

          public double ysRss()

      Returns sum of squared errors.
      Returns:
        Sum of squared errors

    - #### ysVariance

          public double ysVariance()

      Returns label variance.
      Returns:
        Label variance.

    - #### getRss

          public double getRss()

      Returns RSS.
      Returns:
        RSS.

2022 Copyright © Apache Software Foundation
| Follow @ApacheIgnite
Ignite Database and Caching Platform | : ver. 2.12.0
Release Date | : January 10 2022