ROC curve with multiclass SVM

조회 수: 3 (최근 30일)
kav
kav 2020년 4월 4일
댓글: Gorkem Akgul 2021년 5월 14일
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')
  댓글 수: 1
Gorkem Akgul
Gorkem Akgul 2021년 5월 14일
Could you solve the problem ?

댓글을 달려면 로그인하십시오.

채택된 답변

Harsha Priya Daggubati
Harsha Priya Daggubati 2020년 4월 7일
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
Harsha Priya Daggubati
Harsha Priya Daggubati 2020년 4월 8일
What is the issue with this case?
kav
kav 2020년 4월 8일
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)

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Detection에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by