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

点个赞呗~

相关推荐
for_ever_love__7 小时前
线性回归与梯度下降——从零手写一个模型
python·机器学习·线性回归·梯度下降
付威20238 小时前
【pi-rust源码拆解】Agent 源码看不懂?先跟着一条消息走一遍--万字长文
人工智能
老马识码8 小时前
复杂架构的取舍:Agentic RAG、LLM Wiki 与 Multi-Agent
人工智能
Maynor9968 小时前
让 AI 编程助手学会做视频、做 PPT:Agent Skills 入门与安装全指南
人工智能·aigc·ai编程·效率工具·cursor·claude code
C++ 老炮儿的技术栈8 小时前
sizeof操作符
c语言·c++·人工智能·mfc·c
柯南46688 小时前
【AI工程师精讲】KV Cache 精讲:为什么 AI 越聊越慢,以及长上下文真正的成本在哪
人工智能·ai编程
QCoding8 小时前
Spring AI Alibaba Graph实战:从ReAct Agent到Workflow,企业AI复杂流程该如何编排?
java·人工智能
小蒋观天下8 小时前
端侧大模型在安防摄像头部署实操(上)|行业痛点、架构选型、落地思路解析
大数据·人工智能·安全·计算机视觉·ai大模型
hzxxxz8 小时前
端到端测速数据采集实战:从节点部署到指标口径的完整链路
人工智能
林伽一9 小时前
能力趋同、账单分化,技术选型正在从榜单转向负载|2026年10月06日
人工智能·科技·安全·ai