我有一个称为 DataFrameX
和一组称为Y
.
对于我的大多数模型,我会做这样的事情(只是一个例子):
from sklearn.linear_model import LassoCV
clf = LassoCV()
score = cross_val_score(estimator = clf, X = X, y = Y, cv = KFold(n_splits = 3, random_state = 100), n_jobs = -1, \
scoring = "neg_mean_squared_error")
np.mean([np.sqrt(-x) for x in score])
我正在尝试以类似的方式使用 TPOT,如下所示:
from tpot import TPOTRegressor
tpot = TPOTRegressor(generations=20, population_size=100, verbosity=2)
score = cross_val_score(estimator = tpot, X = X, y = Y, cv = KFold(n_splits = 3, random_state = 100), n_jobs = -1, \
scoring = "neg_mean_squared_error")
np.mean([np.sqrt(-x) for x in score])
TPOT 启动但随后给我一个酸洗错误,如下所示:
PicklingError: Can't pickle <type 'instancemethod'>: it's not found as __builtin__.instancemethod
知道为什么会发生这种情况/如何让 TPOT 发挥出色吗?
谢谢!