ValidationSC: ValidationSC

Description Usage Arguments Details See Also Examples

View source: R/stopCriteria.R

Description

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

Usage

1

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
# 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)

IBHM documentation built on May 30, 2017, 4:32 a.m.