ROC curve with multiclass SVM

4 visualizzazioni (ultimi 30 giorni)
kav
kav il 4 Apr 2020
Commentato: Gorkem Akgul il 14 Mag 2021
Hello All,
I am plotting the ROC curve for SVM multiclass(3 classes) task. Getting the error as "Index in position 2 exceeds array bounds (must not exceed 3)"
Error in ROC_SVM (line 70)
scores = double(score(:,final_best_SVM.ClassNames + 1))'; % Compute the posterior probabilities (scores)
My code is
%% Plotting ROC curve for SVM
[predictedLabels,score,cost] = predict(final_best_SVM, features_Testing);
scores = double(score(:,final_best_SVM.ClassNames + 1))'; % Compute the posterior probabilities (scores)
figure(2)
plotroc(dtTest_lab,scores)
title('ROC Curve for SVM')

Risposta accettata

Harsha Priya Daggubati
Harsha Priya Daggubati il 7 Apr 2020
Hi,
The number of columns of score matrix will be equal to your classes, in your case it is 3. Since you are using +1 in the following line, this issue pops up.
scores = double(score(:,final_best_SVM.ClassNames + 1))
  18 Commenti
Harsha Priya Daggubati
Harsha Priya Daggubati il 8 Apr 2020
What is the issue with this case?
kav
kav il 8 Apr 2020
I think its same as before problem.
Error using network/sim (line 270)
Input data sizes do not match net.inputs{1}.size.
Error in ROC_MLP (line 79)
simpleclusterOutputs = sim(netBest,features_Training)

Accedi per commentare.

Più risposte (0)

Community Treasure Hunt

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

Start Hunting!

Translated by