GradientBoostedRandomForest + RFECV + GridSearchCV

31 Views Asked by At

I am following this logic to select features and then optimize for the hyperparameters:

rf = GradientBoostingRegressor()
model = RFECV(rf, step=1, cv=KFold(cv_count,shuffle=True), n_jobs=-1)
model.fit(X_train, y_train)
random_grid ={'estimator__n_estimators': [20] }   #example
model_grid_search = GridSearchCV(estimator=model, param_grid=random_grid,
                                     cv=KFold(cv_count,shuffle=True), verbose=0, 
                                     n_jobs=-1, return_train_score=True,
                                     scoring='neg_mean_squared_error')

model_grid_search.fit(X_train, y_train)

This is running into errors. File "sklearn/ensemble/_gradient_boosting.pyx", line 216, in sklearn.ensemble.gradient_boosting.predict_stages AttributeError: 'NoneType' object has no attribute 'tree' FitFailedWarning

RFECV and GridSearchCV separately have no problem running. What could be the issue?

0

There are 0 best solutions below