我是 python sklearn 的新手。自从我迁移到 Python 3 后,我的代码开始需要更多时间来运行 RFECV ......它从 5 小时到几乎 15 小时来运行几个 RFE CV。我找到了这个链接,但我想这个案例与我的不同:为什么 Python 3 比 Python 2 慢得多?
以下是代码示例:
for fs_method, fs_dict in fs_models.items():
print(fs_method)
pickle_dict[fs_method] = dict()
pipe = pipeline_classifier(fs_dict['clf'])
for score in fs_scorers:
print (score)
feature_selector_cv = skf.RFECV(pipe,
cv=kf,
step=rfecv_step,
scoring=score.replace('-', '_'),
n_jobs=-1
)
feature_selector_cv.fit(X_train, y_train)
会不会是sklearn版本不同造成的?