#include <ValidationError.h>

Public Member Functions | |
| ValidationError (ErrorFunction *base, Optimizer *opt, int iter, double holdOutFraction=0.2) | |
| Constructor. | |
| ~ValidationError () | |
| Descructor. | |
| double | error (Model &model, const Array< double > &input, const Array< double > &target) |
| Hold-out error computation:. | |
| double | errorDerivative (Model &model, const Array< double > &input, const Array< double > &target, Array< double > &derivative) |
| Hold-out error computation: The data are split into training and validation datasets. | |
Protected Attributes | |
| ErrorFunction * | baseError |
| error function for training and evaluation | |
| Optimizer * | optimizer |
| optimizer for machine training | |
| int | iterations |
| number of training iterations | |
| double | holdOut |
| fraction of the data used for evaluation | |
Definition at line 63 of file ValidationError.h.
| ValidationError::ValidationError | ( | ErrorFunction * | base, | |
| Optimizer * | opt, | |||
| int | iter, | |||
| double | holdOutFraction = 0.2 | |||
| ) |
Constructor.
| base | error function for machine training and evaluation of the validation set | |
| opt | optimizer for machine training | |
| iter | number of optimization iterations | |
| holdOutFraction | fraction of the data in the hold out set |
Definition at line 50 of file ValidationError.cpp.
References baseError, holdOut, iterations, and optimizer.
| ValidationError::~ValidationError | ( | ) |
| double ValidationError::error | ( | Model & | model, | |
| const Array< double > & | input, | |||
| const Array< double > & | target | |||
| ) | [virtual] |
Hold-out error computation:.
Implements ErrorFunction.
Definition at line 63 of file ValidationError.cpp.
References baseError, ErrorFunction::error(), holdOut, i, Optimizer::init(), iterations, Optimizer::optimize(), and optimizer.
| double ValidationError::errorDerivative | ( | Model & | model, | |
| const Array< double > & | input, | |||
| const Array< double > & | target, | |||
| Array< double > & | derivative | |||
| ) | [virtual] |
Hold-out error computation: The data are split into training and validation datasets.
The model is trained on the training subset with the given base error function and the given optimizer for the predefined number of iterations. The method reports the error on the validation set, including its derivative. Make sure that the derivative computation for the base error is implemented before using this function.
Reimplemented from ErrorFunction.
Definition at line 103 of file ValidationError.cpp.
References baseError, ErrorFunction::errorDerivative(), holdOut, i, Optimizer::init(), iterations, Optimizer::optimize(), and optimizer.
ErrorFunction* ValidationError::baseError [protected] |
error function for training and evaluation
Definition at line 93 of file ValidationError.h.
Referenced by error(), errorDerivative(), and ValidationError().
double ValidationError::holdOut [protected] |
fraction of the data used for evaluation
Definition at line 102 of file ValidationError.h.
Referenced by error(), errorDerivative(), and ValidationError().
int ValidationError::iterations [protected] |
number of training iterations
Definition at line 99 of file ValidationError.h.
Referenced by error(), errorDerivative(), and ValidationError().
Optimizer* ValidationError::optimizer [protected] |
optimizer for machine training
Definition at line 96 of file ValidationError.h.
Referenced by error(), errorDerivative(), and ValidationError().