AttributeError: 'SimpleImputer' object has no attribute '_validate_data' in PyCaret
AttributeError: 'SimpleImputer' object has no attribute '_validate_data' in PyCaret
我在使用 PyCaret 时遇到错误。
AttributeError: 'SimpleImputer' object has no attribute '_validate_data'
正在尝试创建基本实例。
# Create a basic PyCaret instance
import pycaret
from pycaret.regression import *
mlb_pycaret = setup(data = pycaret_df, target = 'pts', train_size = 0.8, numeric_features = ['home',
'first_time_pitcher'], session_id = 123)
我所有的变量都是数字(我强制其中两个,它们是布尔值)。我的目标变量是 label
,这是默认设置。
我还安装了 PyCaret
,导入了它的回归,然后重新安装了 scikit learn
,将 SimpleImputer
导入为 from sklearn.impute import SimpleImputer
OBP_avg Numeric
SLG_avg Numeric
SB_avg Numeric
RBI_avg Numeric
R_avg Numeric
home Numeric
first_time_pitcher Numeric
park_ratio_OBP Numeric
park_ratio_SLG Numeric
SO_avg_p Numeric
pts_500_parkadj_p Numeric
pts_500_parkadj Numeric
SLG_avg_parkadj Numeric
OPS_avg_parkadj Numeric
SLG_avg_parkadj_p Numeric
OPS_avg_parkadj_p Numeric
pts_BxP Numeric
SLG_BxP Numeric
OPS_BxP Numeric
whip_SO_BxP Numeric
whip_SO_B Numeric
whip_SO_B_parkadj Numeric
order Numeric
ops x pts_500 order15 Numeric
ops x pts_500 parkadj Numeric
ops23 x pts_500 Numeric
ops x pts_500 orderadj Numeric
whip_p Numeric
whip_SO_p Numeric
whip_SO_parkadj_p Numeric
whip_parkadj_p Numeric
pts Label
我的回溯如下:
这里的问题在于插补。每个 pycaret documentation 的默认值是 'simple' 但在这种情况下,您需要将其设置为 imputation_type='iterative'
才能正常工作。
库不兼容,重新安装pycaret:pip install pycaret pandas shap
我在使用 PyCaret 时遇到错误。
AttributeError: 'SimpleImputer' object has no attribute '_validate_data'
正在尝试创建基本实例。
# Create a basic PyCaret instance
import pycaret
from pycaret.regression import *
mlb_pycaret = setup(data = pycaret_df, target = 'pts', train_size = 0.8, numeric_features = ['home',
'first_time_pitcher'], session_id = 123)
我所有的变量都是数字(我强制其中两个,它们是布尔值)。我的目标变量是 label
,这是默认设置。
我还安装了 PyCaret
,导入了它的回归,然后重新安装了 scikit learn
,将 SimpleImputer
导入为 from sklearn.impute import SimpleImputer
OBP_avg Numeric
SLG_avg Numeric
SB_avg Numeric
RBI_avg Numeric
R_avg Numeric
home Numeric
first_time_pitcher Numeric
park_ratio_OBP Numeric
park_ratio_SLG Numeric
SO_avg_p Numeric
pts_500_parkadj_p Numeric
pts_500_parkadj Numeric
SLG_avg_parkadj Numeric
OPS_avg_parkadj Numeric
SLG_avg_parkadj_p Numeric
OPS_avg_parkadj_p Numeric
pts_BxP Numeric
SLG_BxP Numeric
OPS_BxP Numeric
whip_SO_BxP Numeric
whip_SO_B Numeric
whip_SO_B_parkadj Numeric
order Numeric
ops x pts_500 order15 Numeric
ops x pts_500 parkadj Numeric
ops23 x pts_500 Numeric
ops x pts_500 orderadj Numeric
whip_p Numeric
whip_SO_p Numeric
whip_SO_parkadj_p Numeric
whip_parkadj_p Numeric
pts Label
我的回溯如下:
这里的问题在于插补。每个 pycaret documentation 的默认值是 'simple' 但在这种情况下,您需要将其设置为 imputation_type='iterative'
才能正常工作。
库不兼容,重新安装pycaret:pip install pycaret pandas shap