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

1 visualización (últimos 30 días)
jaah navi
jaah navi el 28 de En. de 2020
Respondida: Walter Roberson el 28 de En. de 2020
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 comentarios
jaah navi
jaah navi el 28 de En. de 2020
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 el 28 de En. de 2020
Check your input Y.

Iniciar sesión para comentar.

Respuestas (1)

Walter Roberson
Walter Roberson el 28 de En. de 2020
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.

Categorías

Más información sobre PHY Components en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by