LSSVM LAB Performance Metrics

6 vues (au cours des 30 derniers jours)
maryam hatami
maryam hatami le 30 Juin 2021
Modifié(e) : Amr Embaby le 26 Août 2023
Hello,
I am using LSSVMLAB to implement Least Square Support Vector Machine Algorithm.
I need to determine the accuracy, FPR, FNR, and other performance metrics results. How can I find them?
This is a code, getting some performance metrics, but it gets more than 1 value for each! It gives the result for each threshold.(For example, for 100 thresholds in ROC, it gets 100 TP results)
[area, se, thresholds, oneMinusSpec, sens, TN, TP, FN, FP] = roc(Y_latent,Y);

Réponse acceptée

maryam hatami
maryam hatami le 3 Juil 2021
I found the answer. All metrics are evaluated from TP, FP, TN, FN getting from the data:
len =length(Yt);
TP = 0;
FP = 0;
TN = 0;
FN = 0;
for i=1:len
if Yt(i)==Yvalid(i)==1
TP=TP+1;
end
if (Yvalid(i)==1) && (Yt(i)~=Yvalid(i))
FP=FP+1;
end
if (Yt(i)==Yvalid(i)==0)
TN=TN+1;
end
if (Yvalid(i)==0) && (Yt(i)~=Yvalid(i))
FN=FN+1;
end
end
TN
FP
FN
TP
fprintf(1,'Precision: %2.2f\n',100*sum(TP)/(TP+FP));
fprintf(1,'Recall: %2.2f\n',100*sum(TP)/(TP+FN));
fprintf(1,'F1_Score: %2.2f\n',2*(prc*recall)/(prc+recall));
fprintf(1,' FPR: %2.2f\n',100*(FP)/(TN+FP));
fprintf(1,' FNR: %2.2f\n',100*(FN)/(TP+FN));
fprintf(1,' TNR: %2.2f\n',100*(TN)/(TN+FP));
fprintf(1,'Accuracy: %2.2f\n',100*(TP+TN)/(TN+TP+FN+FP));
  1 commentaire
Amr Embaby
Amr Embaby le 26 Août 2023
Modifié(e) : Amr Embaby le 26 Août 2023
i'm trying to use robustLssvm function but i get that error :
SWITCH expression must be a scalar or a character vector.
Error in weightingscheme (line 9)
switch wfct Error in Roboustlssvm (line 74)
w = weightingscheme(casses,model.weights,delta);
do you know how to solve it?
my code:
type = 'function estimation';
[Yp,alpha,b,gam,sig2,model] = lssvm(fts_tle_si_x_wz_2_tra_nrm_mtx,tgs_tle_si_x_wz_2_tra.b,type);
model = tunelssvm(model, 'gridsearch','leaveoneoutlssvm', {'mse'});
model = robustlssvm(model);

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur MATLAB 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