Tuesday, November 15, 2022

AI/ML Logistic regression - Accuracy Value

Higher accuracy is indication of model performing better. 

Accuracy = TP+TN/TP+FP+FN+TN

TP = True positives

TN = True negatives

FN = False negatives

TN = True negatives


F1-score = 2*(Recall*Precision)/Recall+Precision where,


Precision = TP/TP+FP

Recall = TP/TP+FN


The scikit library gives better methods to do this

from sklearn.metrics import accuracy_score

accuracy_score(y_true, y_pred)


References:

https://stackoverflow.com/questions/47437893/how-to-calculate-logistic-regression-accuracy

No comments:

Post a Comment