Could anyone help me to solve the error in the following code

조회 수: 1 (최근 30일)
jaah navi
jaah navi 2020년 1월 28일
답변: Walter Roberson 2020년 1월 28일
load fisheriris
X = meas;
Y = species;
Mdl = fitcknn(X,Y,'NumNeighbors',5,'Standardize',1)
predictedY = resubPredict(Mdl)
C=confusionmat(Y,predictedY)
plotconfusion(Y,predictedY)
When i run the code i am getting error in line plotconfusion(Y,predictedY).I am using matlab version 2015a.Could anyone please help me on this.
  댓글 수: 3
jaah navi
jaah navi 2020년 1월 28일
This was the error i am getting
Error using plotconfusion>standard_args (line 249)
Value{1,1} is not numeric or logical.
Error in plotconfusion (line 105)
update_args = standard_args(args{:});
KSSV
KSSV 2020년 1월 28일
Check your input Y.

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

답변 (1개)

Walter Roberson
Walter Roberson 2020년 1월 28일
plotconfusion(categorical(Y),categorical(predictedY))
This will possibly not work if you are still using that old 2015 version of MATLAB you were using before.

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by