How to find the percentage accuracy of LDA classifier?

6 次查看(过去 30 天)
Hi, I'm looking for any code or function that will help me calculate the percentage accuracy of my LDA classifier. Thanks!
  1 个评论
Mohammad Sami
Mohammad Sami 2020-3-30
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

请先登录,再进行评论。

回答(1 个)

Bhargavi Maganuru
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);

类别

Help CenterFile Exchange 中查找有关 Statistics and Machine Learning Toolbox 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by