Learn R Programming

IBHM (version 1.1-11)

ValidationSC: ValidationSC

Description

A validation set based stop criterion for TrainIBHM function creating IBHM approximation models. Should be passed to ConfigureIBHMwhile creating a configuration object.

Usage

ValidationSC(x, y)

Arguments

x
Validation set input arguments, should be convertible to a matrix.
y
Validation set predicted argument, should be convertible to a single column matrix.

Details

The criterion is checked after each iteration and the current model is used to predict values on the validation data set. When the error increases in comparison to the previous iteration, the construction process is stopped, and the changes in the model from the last iteration are undone.

See Also

IterationSC,ConfigureIBHM, TrainIBHM

Examples

Run this code
# Training data
  x <- seq(-3,3,length.out=400)
  y <- tanh(x)
  
  # A held out validation set for the stop criterion
  x.val <- runif(50,min=-6,max=6)
  y.val <- tanh(x.val)
  
  
  # Training the model using the validation set to prevent overfitting
  m <- TrainIBHM(x,y, 
            ConfigureIBHM(stop.criterion = ValidationSC(x.val, y.val))
       )
                      
  summary(m)
  plot(y.val,predict(m,x.val),asp=1)

Run the code above in your browser using DataLab