Effacer les filtres
Effacer les filtres

how to make confusion matrix has class names

8 vues (au cours des 30 derniers jours)
Jerry
Jerry le 14 Mar 2012
Commenté : Vikas le 10 Fév 2014
hi all; is there any way to show class names on the confusionmatrix which is plotted by plotconfusion? I found that the set(h,'XTickLabel') does not work.
Thanks a lot regards

Réponses (1)

Antje
Antje le 23 Mai 2013
Hi!
For me this example works fine:
a=[1 1 0 1 0 0 1 0 1 0 1 1 0 0 1 0 0 0 1 0];
b=[1 0 1 1 0 1 1 0 1 0 1 0 0 0 1 1 0 0 1 0];
figure(1)
plotconfusion(a,b)
xlabel('string')
set(gca,'xticklabel',{'class1' 'class2' ''})
Hope this helps!
  2 commentaires
Vikas
Vikas le 10 Fév 2014
Hi,
If a=[1 1 0 1 0 0 1 0 1 0 1 1 0 0 1 0 0 0 1 0]; b=[1 0 1 1 0 1 1 0 1 0 1 0 0 0 1 1 0 0 1 0]; a=[1 1 0 1 0 0 1 0 1 0 1 1 0 0 1 0 0 1 1 0]; b=[1 0 1 1 0 1 1 0 1 1 1 0 0 0 1 1 0 0 1 0]; and using plotconfusion(a,b,'name1',c,d,'name2') then is there way to change the name of class in both the plots?
Vikas
Vikas le 10 Fév 2014
Hi,
If a=[1 1 0 1 0 0 1 0 1 0 1 1 0 0 1 0 0 0 1 0]; b=[1 0 1 1 0 1 1 0 1 0 1 0 0 0 1 1 0 0 1 0]; c=[1 1 0 1 0 0 1 0 1 0 1 1 0 0 1 0 0 1 1 0]; d=[1 0 1 1 0 1 1 0 1 1 1 0 0 0 1 1 0 0 1 0]; and using plotconfusion(a,b,'name1',c,d,'name2') then is there way to change the name of class in both the plots?

Connectez-vous pour commenter.

Catégories

En savoir plus sur Numeric Types dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by