How to get 10 fold cross validation results.

조회 수: 1 (최근 30일)
Basavaraja V
Basavaraja V 2018년 4월 16일
답변: Muskan 2024년 9월 25일
If there is any way to get 10 confusion matrices or accuracy of the 10 fold cross validation for svm classifier.

답변 (1개)

Muskan
Muskan 2024년 9월 25일
Hi,
You can use the MATLAB function "kfoldPredict" to classify observations in cross-validated classification mode. You can also use MATLAB's built in function "confusionmat" to compute confusion matrix for classification problem. Here is an example as mentioned in the following documentation on how to achieve the same: https://www.mathworks.com/help/stats/confusionmat.html
g1 = [3 2 2 3 1 1]'; % Known groups
g2 = [4 2 3 NaN 1 1]'; % Predicted groups
C = confusionmat(g1,g2) ; % Returns the confusion matrix
In order to evaluate your model's performance, you can use MATLAB's function "perfcurve". Please refer to the following documentation of "perfcurve" for a better understanding: https://www.mathworks.com/help/stats/perfcurve.html
I hope this helps!

카테고리

Help CenterFile Exchange에서 Statistics and Machine Learning Toolbox에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by