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

点个赞呗~

相关推荐
风吹乱了我的头发~11 小时前
Day52:2026年3月20日打卡
算法
测试_AI_一辰14 小时前
AI测试工程笔记 05:AI评测实践(从数据集到自动评测闭环)
人工智能·笔记·功能测试·自动化·ai编程
云境筑桃源哇15 小时前
海洋ALFA:主权与创新的交响,开启AI生态新纪元
人工智能
2401_8318249616 小时前
基于C++的区块链实现
开发语言·c++·算法
liliangcsdn16 小时前
LLM复杂数值的提取计算场景示例
人工智能·python
We་ct16 小时前
LeetCode 918. 环形子数组的最大和:两种解法详解
前端·数据结构·算法·leetcode·typescript·动态规划·取反
愣头不青16 小时前
238.除了自身以外数组的乘积
数据结构·算法
小和尚同志16 小时前
OpenCodeUI 让你随时随地 AI Coding
人工智能·aigc·ai编程
AI视觉网奇16 小时前
2d 数字人解决方案-待机动作
人工智能·计算机视觉
王上上16 小时前
# 【机器学习-20】-数值计算误差、逻辑回归/Softmax的数值稳定性优化、以及TensorFlow实现细节
机器学习·tensorflow·逻辑回归