2021-02-23
阅读量:
2245
python报错:AttributeError: ' LogisticRegression’object has no attribute roc_ auc_ score
问:
python报错:AttributeError: ' LogisticRegression’object has no attribute roc_ auc_ score
roc-auc-score不能用在逻辑回归上吗
答:
可以的,roc_auc_score是sklearn.metrics下的函数,不是逻辑回归专用的方法,因此调用方法为:
from sklearn.metrics import roc_auc_score
sklearn.metrics.roc_auc_score(y_true, y_pre)
其中,y_true是测试集真实y的值,y_pre是测试集预测y的值






评论(0)


暂无数据
推荐帖子
0条评论
0条评论
0条评论