小编Vom*_*rfe的帖子

将分类报告的准确性返回到列表中

我正在使用 Sklean 的分类报告来总结我的训练和测试时期。

sklearn.metrics.classification_report
Run Code Online (Sandbox Code Playgroud)

我在每个时期都会得到这样的回报:

>>> from sklearn.metrics import classification_report
>>> y_true
>>> y_pred 
>>> target_names = ['class 0', 'class 1', 'class 2']
>>> print(classification_report(y_true, y_pred, target_names=target_names))
              precision    recall  f1-score   support

     class 0       0.50      1.00      0.67         1
     class 1       0.00      0.00      0.00         1
     class 2       1.00      0.67      0.80         3

    accuracy                           0.60         5
   macro avg       0.50      0.56      0.49         5
weighted avg       0.70      0.60      0.61         5
Run Code Online (Sandbox Code Playgroud)

(例如来自 sklearn 脚本)

现在我正在寻找一种方法,以获得列表中每个时期的准确性,以计算所有准确性的平均值和标准差。

这个问题似乎很微不足道,但正如你在我对 Python/机器学习还很陌生之前从我的问题中看到的那样。

感谢您的帮助

狮子座

python return scikit-learn

3
推荐指数
1
解决办法
6611
查看次数

标签 统计

python ×1

return ×1

scikit-learn ×1