AttributeError: 'OneHotEncoder' object has no attribute 'categories_'


解决办法:

更新sklearn库

具体方法:

1.打开anaconda下的anaconda的Promote

2.输入 pip list 可以查看当前已经安装的包和版本

3.更新sklearn:

输入”conda update scikit-learn”

参考:

https://blog.csdn.net/Norsaa/article/details/102701546?utm_medium=distribute.pc_relevant.none-task-blog-baidujs-1

AttributeError: 'OneHotEncoder' object has no attribute 'n_values_'

安装指定version的包:

pip install scikit-learn==0.19.2


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM