Exercise M6.05

The notebook says:

“First, create a histogram gradient boosting regressor. You can set the trees number to be large, and configure the model to use early-stopping.”

Two notes:

  • there could be a note here regarding needing to use from sklearn.experimental import enable_hist_gradient_boosting
  • when creating an HistGradientBoostingRegressor () you can’t actually set the number of estimators.

Am I missing something?

Hi Lokijota,

When you create your HGBR you can fix a large number of tree with max_iter

1 Like

We add the note in the first couple of notebooks and assess that one should start to be autonomous at this stage.

Je me rappelle plus bien mais il était pas censé y avoir une erreur avec un message qui aide quand on oublie d’importer sklearn.experimental ? Ça semble pas le cas en tout cas :

In [1]: from sklearn.ensemble import HistGradientBoostingClassifier
---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-1-d6293110ba11> in <module>
----> 1 from sklearn.ensemble import HistGradientBoostingClassifier

ImportError: cannot import name 'HistGradientBoostingClassifier' from 'sklearn.ensemble' (/home/lesteve/miniconda3/lib/python3.9/site-packages/sklearn/ensemble/__init__.py)