How to find the percentage accuracy of LDA classifier?

11 visualizaciones (últimos 30 días)
Zuha Yousuf
Zuha Yousuf el 30 de Mzo. de 2020
Respondida: Bhargavi Maganuru el 2 de Abr. de 2020
Hi, I'm looking for any code or function that will help me calculate the percentage accuracy of my LDA classifier. Thanks!
  1 comentario
Mohammad Sami
Mohammad Sami el 30 de Mzo. de 2020
How did you train your classifier.
The following functions will help you. check documentations for more details
confusionchart Create confusion matrix chart for classification problem
confusionmat Compute confusion matrix for classification problem
perfcurve Receiver operating characteristic (ROC) curve or other performance curve for classifier output

Iniciar sesión para comentar.

Respuestas (1)

Bhargavi Maganuru
Bhargavi Maganuru el 2 de Abr. de 2020
If you have true classes and predicted classes, you can create confusion matrix from it
c = confusionmat(true,predicted);
and find the accuracy using
accuracy = sum(diag(c))/sum(c);

Categorías

Más información sobre Statistics and Machine Learning Toolbox en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by