如何在 MATLAB 中使用交叉验证

How to use cross validation in MATLAB

我正在尝试使用 Matlab 制作一个 svm classificator,并希望使用交叉验证。但 predictor = fitcsvm(features, vect, 'Standardize', true, 'CrossVal', 'on'); returns ClassificationPartitionedModel 和函数 predict 不能与属于此 class 的预测器一起操作。那么,我应该如何使用 ClassificationPartitionedModel 预测器进行预测?

您可以使用kfoldpredict for this purpose. It operates on the ClassificationPartitionedModel class. You can retrieve the classification loss using the allied kfoldloss功能。