Mistake in code

Hello, FUN Team!

I think I found a mistake in Lecture: Gradient-boosting decision tree.

This is correct. I corrected this mistake in FIX mistake regarding variable used in cross-validation · INRIA/scikit-learn-mooc@f669d8c · GitHub

Synchronizing the notebooks in FUN should be enough to see the changes.

I think that it hapens too with the code in Speeding-up gradient-boosting lecture with the penultimate cell when the HistGradientBoostingClassifier is applied.

The code is:

from sklearn.experimental import enable_hist_gradient_boosting
from sklearn.ensemble import HistGradientBoostingRegressor

histogram_gradient_boosting = HistGradientBoostingRegressor(
max_iter=200, random_state=0)
cv_results_hgbdt = cross_validate(
gradient_boosting, data, target, scoring=“neg_mean_absolute_error”,
n_jobs=-1,
)

I think the correct should be:

from sklearn.experimental import enable_hist_gradient_boosting
from sklearn.ensemble import HistGradientBoostingRegressor

histogram_gradient_boosting = HistGradientBoostingRegressor(
max_iter=200, random_state=0)
cv_results_hgbdt = cross_validate(
histogram_gradient_boosting, data, target, scoring=“neg_mean_absolute_error”,
n_jobs=-1,
)

Correct?

Thanks for your time

Thanks for reporting this, I think this has already been fixed.

Can you make sure you have reset your notebook as explained in How to reset a notebook to its original version?. Note you will lose all your changes in your notebook if you reset it.