python – scikit中roc_curve的阈值学习

python – scikit中roc_curve的阈值学习,第1张

概述我指的是下面的链接和示例,并从这个页面发布我感到困惑的情节图.我的困惑是,只有4个阈值,但似乎roc曲线有很多数据点(> 4个数据点),想知道roc_curve如何在底层找到更多的数据点? http://scikit-learn.org/stable/modules/model_evaluation.html#roc-metrics >>> import numpy as np>>> from 我指的是下面的链接和示例,并从这个页面发布我感到困惑的情节图.我的困惑是,只有4个阈值,但似乎roc曲线有很多数据点(> 4个数据点),想知道roc_curve如何在底层找到更多的数据点?

http://scikit-learn.org/stable/modules/model_evaluation.html#roc-metrics

>>> import numpy as np>>> from sklearn.metrics import roc_curve>>> y = np.array([1,1,2,2])>>> scores = np.array([0.1,0.4,0.35,0.8])>>> fpr,tpr,thresholds = roc_curve(y,scores,pos_label=2)>>> fprarray([ 0.,0.5,1. ])>>> tprarray([ 0.5,1.,1. ])>>> thresholdsarray([ 0.8,0.1 ])

解决方法 该情节实际上来自这个例子: http://scikit-learn.org/stable/auto_examples/model_selection/plot_roc.html 总结

以上是内存溢出为你收集整理的python – scikit中roc_curve的阈值学习全部内容,希望文章能够帮你解决python – scikit中roc_curve的阈值学习所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/langs/1197700.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-06-03
下一篇 2022-06-03

发表评论

登录后才能评论

评论列表(0条)

保存