Suppose that we have this code in MATLAB R2015b:
SVMModel = fitcsvm(INPUT, output,'KernelFunction','RBF','BoxConstraint',1);
CVSVMModel = crossval(SVMModel);
z = kfoldLoss(CVSVMModel)
In the first line using
fitcsvm
model trained by hole data. what is the purpose of settingCrossval
toon
infitcsvm
(as default we have 10-fold cross-validation with this option)?crossval
andkfoldLoss
using the same method as above? If yes why MATLAB documentation mentioned only this method not settingCrossval
method for cross-validation? If these proceedings are the same how we can get the error rate using the first procedure?When we want to predict feature (this is a prediction model) we need use model which trained with hole data (here it is
SVMModel
object)? Socrossval
andkfoldLoss
are using for only calculating error we don't 10 trained model of this validation method for prediction. Is this is true? Is using whole data valid for neural network models?