clf = tree.DecisionTreeRegressor()
print('finding best features')
sfs1 = SFS(estimator=clf,
k_features=3,
forward=True,
floating=True,
verbose=0,
scoring='neg_mean_squared_error',
n_jobs=1,
cv=3)
pipe = Pipeline([('sfs', sfs1),
('tree', clf)])
param_grid = [
{'sfs__k_features': list(range(4,15)),
'sfs__scoring': ['r2', 'neg_mean_squared_error'],
'sfs__estimator__max_depth': list(range(3,13))}
]
gs = GridSearchCV(estimator=pipe,
param_grid=param_grid,
scoring='neg_mean_squared_error',
n_jobs=13,
verbose=2,
cv=3,
iid=True,
refit=True)