How to use cross validation in MATLAB

853 views Asked by At

I'm trying to make a svm classificator using Matlab and want to use cross validation. But predictor = fitcsvm(features, vect, 'Standardize', true, 'CrossVal', 'on'); returns ClassificationPartitionedModel and function predict can not operate with predictor belongs to this class. So, how should I do predictions using ClassificationPartitionedModel predictor?

1

There are 1 answers

0
Nitish On BEST ANSWER

You can use kfoldpredict for this purpose. It operates on the ClassificationPartitionedModel class. You can retrieve the classification loss using the allied kfoldloss function.