python - 如何使用正确的 sklearn 版本解开和适应机器学习
问题描述
这是我的代码
import joblib
lgbm_v4 = joblib.load('lgbm_v4.pkl')
用户警告
/home/user/.local/lib/python3.6/site-packages/sklearn/base.py:315: UserWarning: Trying to unpickle estimator LabelEncoder from version 0.24.1 when using version 0.24.2. This might lead to breaking code or invalid results. Use at your own risk.
UserWarning)
这是我尝试时的错误消息result = lgbm_v4.score(X_test, y_test)
TypeError: '<' not supported between instances of 'int' and 'str'
TypeError: Labels in y_true and y_pred should be of the same type. Got y_true=['0' '1'] and y_pred=[0 1]. Make sure that the predictions provided by the classifier coincides with the true labels.
TypeError: object of type 'NoneType' has no len()
AttributeError: 'TypeError' object has no attribute '_render_traceback_'
TypeError: attrib() got an unexpected keyword argument 'convert'
我想做什么,我认为是基本代码,为什么错误如此复杂
解决方案
推荐阅读
- javascript - 在角度 8 中通过引用调用组件数组属性
- python - 如何在 .scss 文件中使用来自后端的变量
- mysql - PHP MySQL如何计算行之间的距离?
- powershell - Powershell脚本在DeploymentType中创建注册表检测方法
- c++ - c++ 中的 string a="hello" 和 string a=(char *)"hello" 有什么区别?
- ios - 自定义 VC 转换未正确关闭
- asp.net - WCF,Mtom 消息编码,已超出传入消息的最大消息大小配额 (65536)
- python - 使用 PyOpenGL 创建 GL_GEOMETRY_SHADER 时出错
- grpc - Tensorflow serving(docker):如何获取客户端发送的grpc请求日志?
- c - 为什么 strcmp 似乎不适用于 strtok 返回的字符串?