Ranking VS Classification

再不完善就快成僵尸博客了,呵呵
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
ValueError Traceback (most recent call last) Cell In[20], line 1 ----> 1 fpr, tpr, _ = metrics.roc_curve(test_y, y_pre) 2 plt.plot(fpr, tpr) File D:\anaconda\envs\zuoye\lib\site-packages\sklearn\metrics\_ranking.py:992, in roc_curve(y_true, y_score, pos_label, sample_weight, drop_intermediate) 904 def roc_curve( 905 y_true, y_score, *, pos_label=None, sample_weight=None, drop_intermediate=True 906 ): 907 """Compute Receiver operating characteristic (ROC). 908 909 Note: this implementation is restricted to the binary classification task. (...) 990 array([1.8 , 0.8 , 0.4 , 0.35, 0.1 ]) 991 """ --> 992 fps, tps, thresholds = _binary_clf_curve( 993 y_true, y_score, pos_label=pos_label, sample_weight=sample_weight 994 ) 996 # Attempt to drop thresholds corresponding to points in between and 997 # collinear with other points. These are always suboptimal and do not 998 # appear on a plotted ROC curve (and thus do not affect the AUC). (...) 1003 # but does not drop more complicated cases like fps = [1, 3, 7], 1004 # tps = [1, 2, 4]; there is no harm in keeping too many thresholds. 1005 if drop_intermediate and len(fps) > 2: File D:\anaconda\envs\zuoye\lib\site-packages\sklearn\metrics\_ranking.py:749, in _binary_clf_curve(y_true, y_score, pos_label, sample_weight) 747 y_type = type_of_target(y_true, input_name="y_true") 748 if not (y_type == "binary" or (y_type == "multiclass" and pos_label is not None)): --> 749 raise ValueError("{0} format is not supported".format(y_type)) 751 check_consistent_length(y_true, y_score, sample_weight) 752 y_true = column_or_1d(y_true) ValueError: multiclass format is not supported
06-03
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值