F1-Score "ValueError: Can't handle mix of binary and continuous"
来源:互联网 发布:文件同步备份软件 编辑:程序博客网 时间:2024/06/05 00:51
引用StackOverflow:这里
其实很简单:比如我的真实数据标签是:
array([1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0])
下面是用回归得到的样本得分,注意这是回归得到的分数:
array([ 0.07094605, 0.1994941 , 0.19270157, 0.13379635, 0.04654469,
0.09212494, 0.19952108, 0.12884365, 0.15685076, -0.01274453,
0.32167554, 0.32167554, -0.10023553, 0.09819648, -0.06755516,
0.25390082, 0.17248324])
因为FI-score,accuracy_score这类函数是对二分类问题使用的得分,直接用API会报错:
accuracy_score(y_true, y_pred, normalize=False)
解决方法是使用阈值:
y_pre = [int(item>threshold) for item in y_pred]accuracy_score(y_true, y_pre , normalize=False)
阅读全文
0 0
- F1-Score "ValueError: Can't handle mix of binary and continuous"
- F1-Score
- java.util.Map is an interface, and JAXB can't handle interfaces.
- 报错:java.util.Map is an interface, and JAXB can't handle interfaces.
- 报错:java.util.Map is an interface, and JAXB can't handle interfaces.
- AutoSize and DockStyle.Fill don't mix
- Is it OK to mix categorical and continuous data for SVM (Support Vector Machines)?
- Five Reasons Web 2.0 and Enterprises Don't Mix
- 解决Android中Can't create handle inside thread问题
- Android中Can't create handle inside thread的解决办法
- 解决Android中Can't create handle inside thread问题
- 正确率、召回率、F1-Score
- Continuous Integration Builds – Do’s And Don’t’s
- Illegal mix of collations (gb2312_chinese_ci,IMPLICIT) and (utf8_general_ci,COERCIBLE)
- Illegal mix of collations (utf8_general_ci,IMPLICIT) and (utf8_unicode_ci,IMPLIC )
- Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8_general_ci,COER) 解决办法
- Illegal mix of collations (utf8_general_ci,IMPLICIT) and (utf8_unicode_ci,IMPLIC )
- 解决"Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8_general_ci,COERCIBLE)
- 大数据分析理解
- 测量出管脚的实际宽度和距离-官方实例
- [2017.12.09]9. Palindrome Number 回文数字
- C# 等号和Equals的区别
- 【Scikit-Learn 中文文档】预测延迟 / 预测吞吐量 / 技巧和窍门
- F1-Score "ValueError: Can't handle mix of binary and continuous"
- vue+swiper实现自定义侧滑菜单
- 【Scikit-Learn 中文文档】使用 scikit-learn 介绍机器学习
- django的 {% for %} 中关于forloop的一些方法和属性
- css选择器总结
- 【Scikit-Learn 中文文档】机器学习: scikit-learn 中的设置以及预估对象
- OC踩坑指南(不定期更新)
- Educational Codeforces Round 19 B. Odd sum
- VScode炫酷敲代码插件power mode配置教程