model = RandomBoostingRegressor()
rb = GridSearchCV(model, param_grid={'n_estimators':[75, 100, 150]}, cv=5)
rb = rb.fit(X_train, y_train)
This code fails with an IndexError
File ".../python_random_boost/random_boost/random_boost.py", line 1183, in _fit_stage self.depths_[i] = depth
IndexError: index 100 is out of bounds for axis 0 with size 100
The reason is that RandomBoostingRegressor() is initialized with n_estimators=100, and it seems GridSearchCV() is not able to properly overwrite n_estimators when searching the grid (hence leading to an error when it tries out n_estimators=150. This is not a problem with GradientBoostingRegressor(), which has the same default value for n_estimators.
In essence, the problem is related to the fact that I create a vector in which I save the drawn tree depth values. The length of this vector equals n_estimators and seems to be set to 100 independent from the actual value tried out by GridSearchCV.
This code fails with an IndexError
The reason is that RandomBoostingRegressor() is initialized with
n_estimators=100, and it seems GridSearchCV() is not able to properly overwriten_estimatorswhen searching the grid (hence leading to an error when it tries outn_estimators=150. This is not a problem with GradientBoostingRegressor(), which has the same default value forn_estimators.In essence, the problem is related to the fact that I create a vector in which I save the drawn tree depth values. The length of this vector equals
n_estimatorsand seems to be set to 100 independent from the actual value tried out by GridSearchCV.