How to use 'crossval' without pretrained model?

How can you generate a partitioned model using the 'crossval' function without creating a pretrained model first?

 Accepted Answer

This functionality is not supported by the 'crossval' function. However, one workaround is to use a fit function with the 'CrossVal' name-value argument specified.
For example, to directly generate a partitioned SVM model, you can run the following command:
CV_SVM_model = fitcsvm(X,Y,'CrossVal','on')
To read more about the cross-validation options for the ‘fitcsvm’ function, please refer to the following documentation page: 
Similar steps can be taken with fit functions for other model types.

More Answers (0)

Products

Release

R2022a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!