Azzera filtri
Azzera filtri

How to get accuracy rate, error rate, precission, recall and kappa for fitglm model?

6 visualizzazioni (ultimi 30 giorni)
I Have sintax for GLM Model, and I already get the grafik predicition.
x = [data.a,data.b, data.c];
y = data.d;
disp('model')
model = fitglm(x,y,'linear');
disp(model);
prediction = predict(model,x);
How can i get accuracy rate, error rate, precission, recall and kappa for the accuration prediction?
Thanks

Risposte (1)

Puru Kathuria
Puru Kathuria il 11 Mar 2020
Hi,
I understand that you want to compute the following metrics to evaluate your model. I hope the following explaination helps you in doing so.
Assume the following notations:
C: represent number of classes
: true positives
: false negatives
: True negatives
: False positives
N: total number of test samples
Also, the following is explained for C = 2 , it can be generalized for any value of C.
[ConfusionMat,order] = confusionmat(Y,prediction); % Will return the CxC classes
After you have the confusion matrix, you can compute the following metrics using given formulas:
For your problem, compute Kappa as the following:

Categorie

Scopri di più su Statistics and Machine Learning Toolbox in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by