ValidationSet

ValidationSet

is an option for Predict, Classify, NetTrain, and related functions that specifies the validation set to be used during the training phase.

Details

  • With ValidationSetdata, model and hyperparameter selections are done by testing performance on data. data can be given in any format allowed for the training set.
  • With ValidationSetAutomatic, cross-validation methods on the original data supplied to Predict, Classify, etc. will be used instead.
  • ValidationSetdata is typically used when the data in the training set and the data that one wishes to predict or classify come from different sources.

Examples

open allclose all

Basic Examples  (2)

Train a classifier:

Obtain the L2 regularization coefficient of the classifier:

Specify the validation set explicitly:

A different L2 regularization coefficient has been selected:

Train a predictor with a specified validation set:

Obtain the L2 regularization coefficient of the trained predictor:

Train a predictor without a specified validation set:

A different L2 regularization coefficient has been selected:

Applications  (1)

Load handwritten digits from the MNIST dataset:

Construct a set of digits from your own writing:

Train a classifier that uses the MNIST digits for training and your own digits for validating models and hyperparameters:

Introduced in 2014
 (10.0)