org.encog.ml.train.strategy.end

## Class EarlyStoppingStrategy

- java.lang.Object
- - org.encog.ml.train.strategy.end.EarlyStoppingStrategy

- All Implemented Interfaces:
    EndTrainingStrategy, Strategy

      public class EarlyStoppingStrategy
      extends Object
      implements EndTrainingStrategy

  Stop early when validation set no longer improves. Based on the following paper: techreport{Prechelt94c, author = {Lutz Prechelt}, title = {{PROBEN1} --- {A} Set of Benchmarks and Benchmarking Rules for Neural Network Training Algorithms}, institution = {Fakult\"at f\"ur Informatik, Universit\"at Karlsruhe}, year = {1994}, number = {21/94}, address = {D-76128 Karlsruhe, Germany}, month = sep, note = {Anonymous FTP: /pub/pa\-pers/tech\-reports/1994/1994-21.ps.Z on ftp.ira.uka.de}, }

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `EarlyStoppingStrategy(MLDataSet theValidationSet, MLDataSet theTestSet)` Construct the early stopping strategy.
    `EarlyStoppingStrategy(MLDataSet theValidationSet, MLDataSet theTestSet, int theStripLength, double theAlpha, double theMinEfficiency)` Construct the early stopping strategy.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `double` | `geteOpt()`
    `double` | `getGl()`
    `double` | `getMinEfficiency()`
    `double` | `getStripEfficiency()`
    `int` | `getStripLength()`
    `double` | `getStripOpt()`
    `double` | `getTestError()`
    `double` | `getTrainingError()`
    `double` | `getValidationError()`
    `void` | `init(MLTrain theTrain)` Initialize this strategy.
    `void` | `postIteration()` Called just after a training iteration.
    `void` | `preIteration()` Called just before a training iteration.
    `boolean` | `shouldStop()`

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

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

- - ### Constructor Detail

    - #### EarlyStoppingStrategy

          public EarlyStoppingStrategy(MLDataSet theValidationSet,
                               MLDataSet theTestSet)

      Construct the early stopping strategy. Use default operating parameters.
      Parameters:
        `theValidationSet` - The validation set.
        `theTestSet` - The test set.

    - #### EarlyStoppingStrategy

          public EarlyStoppingStrategy(MLDataSet theValidationSet,
                               MLDataSet theTestSet,
                               int theStripLength,
                               double theAlpha,
                               double theMinEfficiency)

      Construct the early stopping strategy.
      Parameters:
        `theValidationSet` -
        `theTestSet` -
        `theStripLength` - The number of training set elements to validate.
        `theAlpha` - Stop once GL is below this value.
        `theMinEfficiency` - The minimum training efficiency to stop.

  - ### Method Detail

    - #### init

          public void init(MLTrain theTrain)

      Initialize this strategy.
      Specified by:
        `init` in interface `Strategy`
      Parameters:
        `theTrain` - The training algorithm.

    - #### preIteration

          public void preIteration()

      Called just before a training iteration.
      Specified by:
        `preIteration` in interface `Strategy`

    - #### postIteration

          public void postIteration()

      Called just after a training iteration.
      Specified by:
        `postIteration` in interface `Strategy`

    - #### shouldStop

          public boolean shouldStop()

      Specified by:
        `shouldStop` in interface `EndTrainingStrategy`
      Returns:
        Returns true if we should stop.

    - #### getTrainingError

          public double getTrainingError()

      Returns:
        the trainingError

    - #### getTestError

          public double getTestError()

      Returns:
        the testError

    - #### getValidationError

          public double getValidationError()

      Returns:
        the validationError

    - #### geteOpt

          public double geteOpt()

      Returns:
        the eOpt

    - #### getGl

          public double getGl()

      Returns:
        the gl

    - #### getStripLength

          public int getStripLength()

      Returns:
        the stripLength

    - #### getStripOpt

          public double getStripOpt()

      Returns:
        the stripOpt

    - #### getStripEfficiency

          public double getStripEfficiency()

      Returns:
        the stripEfficiency

    - #### getMinEfficiency

          public double getMinEfficiency()

      Returns:
        the minEfficiency

Copyright © 2014. All Rights Reserved.