码迷,mamicode.com
首页 > 其他好文 > 详细

sklearn 模型评估

时间:2019-09-17 18:56:20      阅读:73      评论:0      收藏:0      [点我收藏+]

标签:href   loss   平均值   nbsp   模型   normal   als   矩阵   core   

原文链接

http://d0evi1.com/sklearn/model_evaluation/

预测值:pred

真实值:y_test

 

直接用平均值

mean(pred == y_test)

 

准确得分

from sklearn.metrics import accuracy_score

accuracy_score(pred, y_test)

accuracy_score(pred, y_test, normalize=False)

 

混淆矩阵

from sklearn.metrics import confusion_matrix

confusion_matrix(pred, y_test)

 

 

汉明
from sklearn.metrics import hamming_loss

hamming_loss(pred, y_test)

sklearn 模型评估

标签:href   loss   平均值   nbsp   模型   normal   als   矩阵   core   

原文地址:https://www.cnblogs.com/hichens/p/11536090.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!