# Package com.tibco.patterns.learn.training

Functionality to train, validate, monitor statistics and stop the training of RLink models using datasets of feature vectors. A number of feature vectors can be grouped together in a VectorSet dataset. A Training dataset and a Validation dataset can be grouped together as a VectorExperiment.

An instance of the Trainer class is created for an existing RLink model. It is then used to train that model with an experiment (recommended) or with an individual dataset (not recommended). An experiment can be any subclass of RLinkExperiment, such as VectorExperiment.

The training process uses an implementation of TrainingObserver interface to monitor progress over the training dataset, and an implementation of ConvergenceObserver to monitor progress over the validation dataset. Training is stopped based on criteria defined in the ConvergenceObserver implementation.

This package provides several implementations of ConvergenceObserver. The recommended approach is to use the COErrorRateMin class that finds the training iteration with the minimum validation error rate, then recreate and retrain the model using that exact number of iterations. The COErrorRate class stops the training when a certain error rate over the validation dataset has been reached. The COScoreChange class stops the training when the maximum model score change is below a given threshold. You may derive other classes from ConvergenceObserver or its implementations to use different or additional criteria for monitoring or stopping the training process.

- Interface Summary
  Interface | Description
  --- | ---
  ConvergenceObserver | Defines an object that makes decisions when to stop the training.
  TrainingObserver | Defines an object that gathers training statistics for a certain dataset.

- Class Summary
  Class | Description
  --- | ---
  COErrorRate | Stops the training when the error rate over validation dataset during the last iteration is below the given threshold.
  COErrorRate.IterationResult | Stores statistics for a full or partial training iteration
  COErrorRateMin | Stops the training after a minimum error rate for the validation dataset was found and this result was not improved during the specified number of subsequent iterations.
  COIterationCount | A simple class that counts iterations and stops training after the given maximum number of iterations has been reached.
  COScoreChange | Stops the training when the maximum change in prediction scores compared with the previous iteration is below the given threshold.
  FeatureVector | Stores a feature vector that can be predicted by a Learn model.
  RLinkDataSet<T extends VectorExample> | A container for storing a set of training examples suitable for model training.
  RLinkExperiment<T extends VectorExample> | Manages all data required for a model training experiment: training and validation datasets.
  Trainer | Implements automated training for a single RLink model.
  VectorExample | Stores a feature vector and a label that are used for training the model.
  VectorExperiment | Manages a training dataset and a validation dataset.
  VectorSet | A container for storing a set of VectorExample training examples.

- Enum Summary
  Enum | Description
  --- | ---
  Partition | Defines the type of a dataset: Training or Validation.