机器学习 - metric评估方法

有一些方法来评估classification model。

Metric name / Evaluation method Definition Code
Accuracy Out 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()
Precision Proportion 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()
Recall Proportion 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-score Combines precision and recall into one metric, 1 is best, 0 is worst torchmetrics.F1Score() or sklearn.metrics.f1_score()
Confusion matrix Compares 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 report Collection of some of the main classification metrics such as precision, recall and f1-score. sklearn.metrics.classification_report()

点个赞呗~

相关推荐
小兵张健7 小时前
35岁程序员的春天来了
人工智能
大怪v8 小时前
AI抢饭?前端佬:我要验牌!
前端·人工智能·程序员
冬奇Lab8 小时前
OpenClaw 深度解析(六):节点、Canvas 与子 Agent
人工智能·开源
刀法如飞9 小时前
AI提示词框架深度对比分析
人工智能·ai编程
归去_来兮9 小时前
拉格朗日插值算法原理及简单示例
算法·数据分析·拉格朗日插值
IT_陈寒11 小时前
Python开发者必知的5大性能陷阱:90%的人都踩过的坑!
前端·人工智能·后端
1G11 小时前
openclaw控制浏览器/自动化的playwright MCP + Mcporter方案实现
人工智能
踩着两条虫11 小时前
VTJ.PRO 双向代码转换原理揭秘
前端·vue.js·人工智能
扉川川11 小时前
OpenClaw 架构解析:一个生产级 AI Agent 是如何设计的
前端·人工智能
星浩AI12 小时前
让模型自己写 Skills——从素材到自动生成工作流
人工智能·后端·agent