自学内容网 自学内容网

机器学习 - metric评估方法

有一些方法来评估classification model。

Metric name / Evaluation methodDefinitionCode
AccuracyOut of 100 predictions, how many does your model get correct? E.g. 95% accuracy means it gets 95/100 predictions correct.torchmetrics.Accuracy() or sklearn.metrics.accuracy_score()
PrecisionProportion of true positive over total number of samples. Higher precision leads to less false positives (model predicts 1 when it should’ve been 0).torchmetrics.Precision() or sklearn.metrics.precision_score()
RecallProportion of true positives over total number of true positives and false negatives (model predicts 0 when it should’ve been 1). Higher recall leads to less false negatives.torchmetrics.Recall() or sklearn.metrics.recall_score()
F1-scoreCombines precision and recall into one metric, 1 is best, 0 is worsttorchmetrics.F1Score() or sklearn.metrics.f1_score()
Confusion matrixCompares the predicted values with the true values in a tabular way, if 100% correct, all values in the matrix will be top left to bottom right (diagnoal line).torchmetrics.ConfusionMatrix or sklearn.metrics.plot_confusion_matrix()
Classification reportCollection of some of the main classification metrics such as precision, recall and f1-score.sklearn.metrics.classification_report()

点个赞呗~


原文地址:https://blog.csdn.net/BSCHN123/article/details/137402988

免责声明:本站文章内容转载自网络资源,如本站内容侵犯了原著者的合法权益,可联系本站删除。更多内容请关注自学内容网(zxcms.com)!