首页 > 解决方案 > 如何使用正确的 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'


我想做什么,我认为是基本代码,为什么错误如此复杂

标签: pythonpandasscikit-learn

解决方案


推荐阅读