Vladimir
Vladimir

Reputation: 179

How to use cross validation in MATLAB

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?

Upvotes: 1

Views: 830

Answers (1)

Nitish
Nitish

Reputation: 7116

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

Upvotes: 2

Related Questions