机器学习 - 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()

点个赞呗~

相关推荐
Destiny_where4 分钟前
Langgraph基础(4)-中断interrupt.实现图执行的动态暂停与外部交互
人工智能·python·langchain·langgraph
147API15 分钟前
多模型时代,如何根据任务轻重合理分配模型资源?
人工智能·大模型api·api中转·ai架构
boonya17 分钟前
一文读懂MCP:AI连接万物的“USB-C接口”
c语言·开发语言·人工智能
石榴树下的七彩鱼19 分钟前
图片去水印 API 哪个好?5种方案实测对比(附避坑指南 + 免费在线体验)
图像处理·人工智能·后端·python·api接口·图片去水印·电商自动化
liliangcsdn20 分钟前
多轮对话长上下文-向量检索和混合召回示例
开发语言·数据库·人工智能·python
MFXWW220 分钟前
特斯拉 Optimus Gen3 手臂设计解析:从 “能抓“ 到 “会用“ 的工程革命
人工智能·机器人
user_admin_god20 分钟前
OpenCode入门到入坑
java·人工智能·spring boot·语言模型
Agent产品评测局20 分钟前
律所行业自动化平台选型,合同审核与案件管理优化 | 2026年法律科技Agent化演进与企业级智能体实测横评
运维·人工智能·科技·ai·chatgpt·自动化
前端不太难21 分钟前
当 AI 出错时,责任在谁?系统设计中的责任归属(Accountability)
人工智能·状态模式