org.apache.ignite.ml.selection.cv

## Class CrossValidation<M extends IgniteModel<Vector,Double>,K,V>

- java.lang.Object
- - org.apache.ignite.ml.selection.cv.AbstractCrossValidation<M,K,V>
  - - org.apache.ignite.ml.selection.cv.CrossValidation<M,K,V>

- Type Parameters:
    `M` - Type of model.
    `K` - Type of a key in `upstream` data.
    `V` - Type of a value in `upstream` data.
  All Implemented Interfaces:
    Serializable

      public class CrossValidation<M extends IgniteModel<Vector,Double>,K,V>
      extends AbstractCrossValidation<M,K,V>

  Cross validation score calculator. Cross validation is an approach that allows to avoid overfitting that is made the following way: the training set is split into k smaller sets. The following procedure is followed for each of the k “folds”:
  - A model is trained using k-1 of the folds as training data;
  - the resulting model is validated on the remaining part of the data (i.e., it is used as a test set to compute a performance measure such as accuracy).
  See Also:
    Serialized Form

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class org.apache.ignite.ml.selection.cv.AbstractCrossValidation

      `AbstractCrossValidation.TaskResult`

  - ### Field Summary

    - ### Fields inherited from class org.apache.ignite.ml.selection.cv.AbstractCrossValidation

      `amountOfFolds, envBuilder, environment, filter, isRunningOnPipeline, mapper, metric, paramGrid, parts, pipeline, preprocessor, trainer`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `CrossValidation()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `double[]` | `scoreByFolds()` Calculates score by folds.
    `CrossValidation<M,K,V>` | `withIgnite(Ignite ignite)`
    `CrossValidation<M,K,V>` | `withUpstreamCache(IgniteCache<K,V> upstreamCache)`

    - ### Methods inherited from class org.apache.ignite.ml.selection.cv.AbstractCrossValidation

      `isRunningOnPipeline, score, scorePipeline, tuneHyperParameters, withAmountOfFolds, withEnvironmentBuilder, withFilter, withMapper, withMetric, withParamGrid, withPipeline, withPreprocessor, withTrainer`

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

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

- - ### Constructor Detail

    - #### CrossValidation

          public CrossValidation()

  - ### Method Detail

    - #### scoreByFolds

          public double[] scoreByFolds()

      Calculates score by folds.
      Specified by:
        `scoreByFolds` in class `AbstractCrossValidation<M extends IgniteModel<Vector,Double>,K,V>`

    - #### withIgnite

          public CrossValidation<M,K,V> withIgnite(Ignite ignite)

      Parameters:
        `ignite` - Ignite.

    - #### withUpstreamCache

          public CrossValidation<M,K,V> withUpstreamCache(IgniteCache<K,V> upstreamCache)

      Parameters:
        `upstreamCache` - Upstream cache.

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