Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 309f135

Browse filesBrowse files
authored
MNT Remove HistGradientBoosting from experimental (#19799)
1 parent a9ae693 commit 309f135
Copy full SHA for 309f135
Expand file treeCollapse file tree

31 files changed

+59
-149
lines changed

‎asv_benchmarks/benchmarks/ensemble.py

Copy file name to clipboardExpand all lines: asv_benchmarks/benchmarks/ensemble.py
-1Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
from sklearn.experimental import enable_hist_gradient_boosting # noqa
21
from sklearn.ensemble import (RandomForestClassifier,
32
GradientBoostingClassifier,
43
HistGradientBoostingClassifier)

‎benchmarks/bench_hist_gradient_boosting.py

Copy file name to clipboardExpand all lines: benchmarks/bench_hist_gradient_boosting.py
-2Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
import matplotlib.pyplot as plt
55
import numpy as np
66
from sklearn.model_selection import train_test_split
7-
# To use this experimental feature, we need to explicitly ask for it:
8-
from sklearn.experimental import enable_hist_gradient_boosting # noqa
97
from sklearn.ensemble import HistGradientBoostingRegressor
108
from sklearn.ensemble import HistGradientBoostingClassifier
119
from sklearn.datasets import make_classification

‎benchmarks/bench_hist_gradient_boosting_adult.py

Copy file name to clipboardExpand all lines: benchmarks/bench_hist_gradient_boosting_adult.py
-1Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
from sklearn.model_selection import train_test_split
55
from sklearn.datasets import fetch_openml
66
from sklearn.metrics import accuracy_score, roc_auc_score
7-
from sklearn.experimental import enable_hist_gradient_boosting # noqa
87
from sklearn.ensemble import HistGradientBoostingClassifier
98
from sklearn.ensemble._hist_gradient_boosting.utils import (
109
get_equivalent_estimator)

‎benchmarks/bench_hist_gradient_boosting_categorical_only.py

Copy file name to clipboardExpand all lines: benchmarks/bench_hist_gradient_boosting_categorical_only.py
-1Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33

44
from sklearn.preprocessing import KBinsDiscretizer
55
from sklearn.datasets import make_classification
6-
from sklearn.experimental import enable_hist_gradient_boosting # noqa
76
from sklearn.ensemble import HistGradientBoostingClassifier
87
from sklearn.ensemble._hist_gradient_boosting.utils import (
98
get_equivalent_estimator)

‎benchmarks/bench_hist_gradient_boosting_higgsboson.py

Copy file name to clipboardExpand all lines: benchmarks/bench_hist_gradient_boosting_higgsboson.py
-2Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@
99
from joblib import Memory
1010
from sklearn.model_selection import train_test_split
1111
from sklearn.metrics import accuracy_score, roc_auc_score
12-
# To use this experimental feature, we need to explicitly ask for it:
13-
from sklearn.experimental import enable_hist_gradient_boosting # noqa
1412
from sklearn.ensemble import HistGradientBoostingClassifier
1513
from sklearn.ensemble._hist_gradient_boosting.utils import (
1614
get_equivalent_estimator)

‎benchmarks/bench_hist_gradient_boosting_threading.py

Copy file name to clipboardExpand all lines: benchmarks/bench_hist_gradient_boosting_threading.py
-2Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@
77
from threadpoolctl import threadpool_limits
88
import sklearn
99
from sklearn.model_selection import train_test_split
10-
# To use this experimental feature, we need to explicitly ask for it:
11-
from sklearn.experimental import enable_hist_gradient_boosting # noqa
1210
from sklearn.ensemble import HistGradientBoostingRegressor
1311
from sklearn.ensemble import HistGradientBoostingClassifier
1412
from sklearn.datasets import make_classification

‎doc/conf.py

Copy file name to clipboardExpand all lines: doc/conf.py
-1Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,6 @@ def __call__(self, directory):
358358

359359
# enable experimental module so that experimental estimators can be
360360
# discovered properly by sphinx
361-
from sklearn.experimental import enable_hist_gradient_boosting # noqa
362361
from sklearn.experimental import enable_iterative_imputer # noqa
363362
from sklearn.experimental import enable_halving_search_cv # noqa
364363

‎doc/developers/maintainer.rst

Copy file name to clipboardExpand all lines: doc/developers/maintainer.rst
+24-5Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -363,10 +363,17 @@ deprecation cycle.
363363

364364
To create an experimental module, you can just copy and modify the content of
365365
`enable_hist_gradient_boosting.py
366-
<https://github.com/scikit-learn/scikit-learn/blob/main/sklearn/experimental/enable_hist_gradient_boosting.py>`_,
366+
<https://github.com/scikit-learn/scikit-learn/blob/c9c89cfc85dd8dfefd7921c16c87327d03140a06/sklearn/experimental/enable_hist_gradient_boosting.py>`__,
367367
or
368368
`enable_iterative_imputer.py
369-
<https://github.com/scikit-learn/scikit-learn/blob/main/sklearn/experimental/enable_iterative_imputer.py>`_.
369+
<https://github.com/scikit-learn/scikit-learn/blob/c9c89cfc85dd8dfefd7921c16c87327d03140a06/sklearn/experimental/enable_iterative_imputer.py>`_.
370+
371+
.. note::
372+
373+
These are permalink as in 0.24, where these estimators are still
374+
experimental. They might be stable at the time of reading - hence the
375+
permalink. See below for instructions on the transition from experimental
376+
to stable.
370377

371378
Note that the public import path must be to a public subpackage (like
372379
``sklearn/ensemble`` or ``sklearn/impute``), not just a ``.py`` module.
@@ -379,14 +386,15 @@ in the future when the features aren't experimental anymore.
379386
To avoid type checker (e.g. mypy) errors a direct import of experimental
380387
estimators should be done in the parent module, protected by the
381388
``if typing.TYPE_CHECKING`` check. See `sklearn/ensemble/__init__.py
382-
<https://github.com/scikit-learn/scikit-learn/blob/main/sklearn/ensemble/__init__.py>`_,
389+
<https://github.com/scikit-learn/scikit-learn/blob/c9c89cfc85dd8dfefd7921c16c87327d03140a06/sklearn/ensemble/__init__.py>`_,
383390
or `sklearn/impute/__init__.py
384-
<https://github.com/scikit-learn/scikit-learn/blob/main/sklearn/impute/__init__.py>`_
391+
<https://github.com/scikit-learn/scikit-learn/blob/c9c89cfc85dd8dfefd7921c16c87327d03140a06/sklearn/impute/__init__.py>`_
385392
for an example.
386393

387394
Please also write basic tests following those in
388395
`test_enable_hist_gradient_boosting.py
389-
<https://github.com/scikit-learn/scikit-learn/blob/main/sklearn/experimental/tests/test_enable_hist_gradient_boosting.py>`_.
396+
<https://github.com/scikit-learn/scikit-learn/blob/c9c89cfc85dd8dfefd7921c16c87327d03140a06/sklearn/experimental/tests/test_enable_hist_gradient_boosting.py>`__.
397+
390398

391399
Make sure every user-facing code you write explicitly mentions that the feature
392400
is experimental, and add a ``# noqa`` comment to avoid pep8-related warnings::
@@ -402,3 +410,14 @@ sklearn.experimental import *`` **does not work**.
402410

403411
Note that some experimental classes / functions are not included in the
404412
:mod:`sklearn.experimental` module: ``sklearn.datasets.fetch_openml``.
413+
414+
Once the feature become stable, remove all `enable_my_experimental_feature`
415+
in the scikit-learn code (even feature highlights etc.) and make the
416+
`enable_my_experimental_feature` a no-op that just raises a warning:
417+
`enable_hist_gradient_boosting.py
418+
<https://github.com/scikit-learn/scikit-learn/blob/main/sklearn/experimental/enable_hist_gradient_boosting.py>`__.
419+
The file should stay there indefinitely as we don't want to break users code:
420+
we just incentivize them to remove that import with the warning.
421+
422+
Also update the tests accordingly: `test_enable_hist_gradient_boosting.py
423+
<https://github.com/scikit-learn/scikit-learn/blob/main/sklearn/experimental/tests/test_enable_hist_gradient_boosting.py>`__.

‎doc/modules/ensemble.rst

Copy file name to clipboardExpand all lines: doc/modules/ensemble.rst
+2-14Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -467,7 +467,7 @@ trees.
467467

468468
.. note::
469469

470-
Scikit-learn 0.21 introduces two new experimental implementations of
470+
Scikit-learn 0.21 introduces two new implementations of
471471
gradient boosting trees, namely :class:`HistGradientBoostingClassifier`
472472
and :class:`HistGradientBoostingRegressor`, inspired by
473473
`LightGBM <https://github.com/Microsoft/LightGBM>`__ (See [LightGBM]_).
@@ -898,7 +898,7 @@ based on permutation of the features.
898898
Histogram-Based Gradient Boosting
899899
=================================
900900

901-
Scikit-learn 0.21 introduced two new experimental implementations of
901+
Scikit-learn 0.21 introduced two new implementations of
902902
gradient boosting trees, namely :class:`HistGradientBoostingClassifier`
903903
and :class:`HistGradientBoostingRegressor`, inspired by
904904
`LightGBM <https://github.com/Microsoft/LightGBM>`__ (See [LightGBM]_).
@@ -920,15 +920,6 @@ estimators is slightly different, and some of the features from
920920
:class:`GradientBoostingClassifier` and :class:`GradientBoostingRegressor`
921921
are not yet supported, for instance some loss functions.
922922

923-
These estimators are still **experimental**: their predictions
924-
and their API might change without any deprecation cycle. To use them, you
925-
need to explicitly import ``enable_hist_gradient_boosting``::
926-
927-
>>> # explicitly require this experimental feature
928-
>>> from sklearn.experimental import enable_hist_gradient_boosting # noqa
929-
>>> # now you can import normally from ensemble
930-
>>> from sklearn.ensemble import HistGradientBoostingClassifier
931-
932923
.. topic:: Examples:
933924

934925
* :ref:`sphx_glr_auto_examples_inspection_plot_partial_dependence.py`
@@ -941,7 +932,6 @@ Most of the parameters are unchanged from
941932
One exception is the ``max_iter`` parameter that replaces ``n_estimators``, and
942933
controls the number of iterations of the boosting process::
943934

944-
>>> from sklearn.experimental import enable_hist_gradient_boosting
945935
>>> from sklearn.ensemble import HistGradientBoostingClassifier
946936
>>> from sklearn.datasets import make_hastie_10_2
947937

@@ -992,7 +982,6 @@ with missing values should go to the left or right child, based on the
992982
potential gain. When predicting, samples with missing values are assigned to
993983
the left or right child consequently::
994984

995-
>>> from sklearn.experimental import enable_hist_gradient_boosting # noqa
996985
>>> from sklearn.ensemble import HistGradientBoostingClassifier
997986
>>> import numpy as np
998987

@@ -1146,7 +1135,6 @@ You can specify a monotonic constraint on each feature using the
11461135
constraint, while -1 and 1 indicate a negative and positive constraint,
11471136
respectively::
11481137

1149-
>>> from sklearn.experimental import enable_hist_gradient_boosting # noqa
11501138
>>> from sklearn.ensemble import HistGradientBoostingRegressor
11511139

11521140
... # positive, negative, and no constraint on the 3 features

‎doc/whats_new/v0.21.rst

Copy file name to clipboardExpand all lines: doc/whats_new/v0.21.rst
+5Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -420,6 +420,11 @@ Support for Python 3.4 and below has been officially dropped.
420420
>>> from sklearn.experimental import enable_hist_gradient_boosting # noqa
421421
>>> # now you can import normally from sklearn.ensemble
422422
>>> from sklearn.ensemble import HistGradientBoostingClassifier
423+
424+
.. note::
425+
Update: since version 1.0, these estimators are not experimental
426+
anymore and you don't need to use `from sklearn.experimental import
427+
enable_hist_gradient_boosting`.
423428

424429
:pr:`12807` by :user:`Nicolas Hug<NicolasHug>`.
425430

‎doc/whats_new/v1.0.rst

Copy file name to clipboardExpand all lines: doc/whats_new/v1.0.rst
+5Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,11 @@ Changelog
137137
target. Additional private refactoring was performed.
138138
:pr:`19162` by :user:`Guillaume Lemaitre <glemaitre>`.
139139

140+
- |Enhancement| :class:`~sklearn.ensemble.HistGradientBoostingClassifier` and
141+
:class:`~sklearn.ensemble.HistGradientBoostingRegressor` are no longer
142+
experimental. They are now considered stable and are subject to the same
143+
deprecation cycles as all other estimators. :pr:`19799` by `Nicolas Hug`_.
144+
140145
:mod:`sklearn.feature_extraction`
141146
.................................
142147

‎examples/ensemble/plot_gradient_boosting_categorical.py

Copy file name to clipboardExpand all lines: examples/ensemble/plot_gradient_boosting_categorical.py
-1Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@
4545
# As a baseline, we create an estimator where the categorical features are
4646
# dropped:
4747

48-
from sklearn.experimental import enable_hist_gradient_boosting # noqa
4948
from sklearn.ensemble import HistGradientBoostingRegressor
5049
from sklearn.pipeline import make_pipeline
5150
from sklearn.compose import make_column_transformer

‎examples/ensemble/plot_monotonic_constraints.py

Copy file name to clipboardExpand all lines: examples/ensemble/plot_monotonic_constraints.py
-1Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
This example was inspired by the `XGBoost documentation
1919
<https://xgboost.readthedocs.io/en/latest/tutorials/monotonic.html>`_.
2020
"""
21-
from sklearn.experimental import enable_hist_gradient_boosting # noqa
2221
from sklearn.ensemble import HistGradientBoostingRegressor
2322
from sklearn.inspection import plot_partial_dependence
2423
import numpy as np

‎examples/ensemble/plot_stack_predictors.py

Copy file name to clipboardExpand all lines: examples/ensemble/plot_stack_predictors.py
-1Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,6 @@ def load_ames_housing():
160160
rf_pipeline
161161

162162
# %%
163-
from sklearn.experimental import enable_hist_gradient_boosting # noqa
164163
from sklearn.ensemble import HistGradientBoostingRegressor
165164

166165
gbdt_pipeline = make_pipeline(

‎examples/inspection/plot_partial_dependence.py

Copy file name to clipboardExpand all lines: examples/inspection/plot_partial_dependence.py
-1Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,6 @@
134134
# Let's now fit a :class:`~sklearn.ensemble.HistGradientBoostingRegressor` and
135135
# compute the partial dependence on the same features.
136136

137-
from sklearn.experimental import enable_hist_gradient_boosting # noqa
138137
from sklearn.ensemble import HistGradientBoostingRegressor
139138

140139
print("Training HistGradientBoostingRegressor...")

‎examples/linear_model/plot_poisson_regression_non_normal_loss.py

Copy file name to clipboardExpand all lines: examples/linear_model/plot_poisson_regression_non_normal_loss.py
-1Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,6 @@ def score_estimator(estimator, df_test):
258258
# least-squares loss. Here we only fit trees with the Poisson loss to keep this
259259
# example concise.
260260

261-
from sklearn.experimental import enable_hist_gradient_boosting # noqa
262261
from sklearn.ensemble import HistGradientBoostingRegressor
263262
from sklearn.preprocessing import OrdinalEncoder
264263

‎examples/release_highlights/plot_release_highlights_0_22_0.py

Copy file name to clipboardExpand all lines: examples/release_highlights/plot_release_highlights_0_22_0.py
-1Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,6 @@
131131
# support for missing values (NaNs). This means that there is no need for
132132
# imputing data when training or predicting.
133133

134-
from sklearn.experimental import enable_hist_gradient_boosting # noqa
135134
from sklearn.ensemble import HistGradientBoostingClassifier
136135

137136
X = np.array([0, 1, 2, np.nan]).reshape(-1, 1)

‎examples/release_highlights/plot_release_highlights_0_23_0.py

Copy file name to clipboardExpand all lines: examples/release_highlights/plot_release_highlights_0_23_0.py
-2Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@
3636
import numpy as np
3737
from sklearn.model_selection import train_test_split
3838
from sklearn.linear_model import PoissonRegressor
39-
from sklearn.experimental import enable_hist_gradient_boosting # noqa
4039
from sklearn.ensemble import HistGradientBoostingRegressor
4140

4241
n_samples, n_features = 1000, 20
@@ -124,7 +123,6 @@
124123
from matplotlib import pyplot as plt
125124
from sklearn.model_selection import train_test_split
126125
from sklearn.inspection import plot_partial_dependence
127-
from sklearn.experimental import enable_hist_gradient_boosting # noqa
128126
from sklearn.ensemble import HistGradientBoostingRegressor
129127

130128
n_samples = 500

‎sklearn/ensemble/__init__.py

Copy file name to clipboardExpand all lines: sklearn/ensemble/__init__.py
+4-9Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
The :mod:`sklearn.ensemble` module includes ensemble-based methods for
33
classification, regression and anomaly detection.
44
"""
5-
import typing
6-
75
from ._base import BaseEnsemble
86
from ._forest import RandomForestClassifier
97
from ._forest import RandomForestRegressor
@@ -21,13 +19,9 @@
2119
from ._voting import VotingRegressor
2220
from ._stacking import StackingClassifier
2321
from ._stacking import StackingRegressor
24-
25-
if typing.TYPE_CHECKING:
26-
# Avoid errors in type checkers (e.g. mypy) for experimental estimators.
27-
# TODO: remove this check once the estimator is no longer experimental.
28-
from ._hist_gradient_boosting.gradient_boosting import ( # noqa
29-
HistGradientBoostingRegressor, HistGradientBoostingClassifier
30-
)
22+
from ._hist_gradient_boosting.gradient_boosting import (
23+
HistGradientBoostingRegressor, HistGradientBoostingClassifier
24+
)
3125

3226
__all__ = ["BaseEnsemble",
3327
"RandomForestClassifier", "RandomForestRegressor",
@@ -37,4 +31,5 @@
3731
"GradientBoostingRegressor", "AdaBoostClassifier",
3832
"AdaBoostRegressor", "VotingClassifier", "VotingRegressor",
3933
"StackingClassifier", "StackingRegressor",
34+
'HistGradientBoostingClassifier', 'HistGradientBoostingRegressor',
4035
]

‎sklearn/ensemble/_hist_gradient_boosting/gradient_boosting.py

Copy file name to clipboardExpand all lines: sklearn/ensemble/_hist_gradient_boosting/gradient_boosting.py
-26Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -887,17 +887,6 @@ class HistGradientBoostingRegressor(RegressorMixin, BaseHistGradientBoosting):
887887
This implementation is inspired by
888888
`LightGBM <https://github.com/Microsoft/LightGBM>`_.
889889
890-
.. note::
891-
892-
This estimator is still **experimental** for now: the predictions
893-
and the API might change without any deprecation cycle. To use it,
894-
you need to explicitly import ``enable_hist_gradient_boosting``::
895-
896-
>>> # explicitly require this experimental feature
897-
>>> from sklearn.experimental import enable_hist_gradient_boosting # noqa
898-
>>> # now you can import normally from ensemble
899-
>>> from sklearn.ensemble import HistGradientBoostingRegressor
900-
901890
Read more in the :ref:`User Guide <histogram_based_gradient_boosting>`.
902891
903892
.. versionadded:: 0.21
@@ -1040,8 +1029,6 @@ class HistGradientBoostingRegressor(RegressorMixin, BaseHistGradientBoosting):
10401029
10411030
Examples
10421031
--------
1043-
>>> # To use this experimental feature, we need to explicitly ask for it:
1044-
>>> from sklearn.experimental import enable_hist_gradient_boosting # noqa
10451032
>>> from sklearn.ensemble import HistGradientBoostingRegressor
10461033
>>> from sklearn.datasets import load_diabetes
10471034
>>> X, y = load_diabetes(return_X_y=True)
@@ -1156,17 +1143,6 @@ class HistGradientBoostingClassifier(ClassifierMixin,
11561143
This implementation is inspired by
11571144
`LightGBM <https://github.com/Microsoft/LightGBM>`_.
11581145
1159-
.. note::
1160-
1161-
This estimator is still **experimental** for now: the predictions
1162-
and the API might change without any deprecation cycle. To use it,
1163-
you need to explicitly import ``enable_hist_gradient_boosting``::
1164-
1165-
>>> # explicitly require this experimental feature
1166-
>>> from sklearn.experimental import enable_hist_gradient_boosting # noqa
1167-
>>> # now you can import normally from ensemble
1168-
>>> from sklearn.ensemble import HistGradientBoostingClassifier
1169-
11701146
Read more in the :ref:`User Guide <histogram_based_gradient_boosting>`.
11711147
11721148
.. versionadded:: 0.21
@@ -1304,8 +1280,6 @@ class HistGradientBoostingClassifier(ClassifierMixin,
13041280
13051281
Examples
13061282
--------
1307-
>>> # To use this experimental feature, we need to explicitly ask for it:
1308-
>>> from sklearn.experimental import enable_hist_gradient_boosting # noqa
13091283
>>> from sklearn.ensemble import HistGradientBoostingClassifier
13101284
>>> from sklearn.datasets import load_iris
13111285
>>> X, y = load_iris(return_X_y=True)

‎sklearn/ensemble/_hist_gradient_boosting/tests/test_compare_lightgbm.py

Copy file name to clipboardExpand all lines: sklearn/ensemble/_hist_gradient_boosting/tests/test_compare_lightgbm.py
-2Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
import numpy as np
55
import pytest
66

7-
# To use this experimental feature, we need to explicitly ask for it:
8-
from sklearn.experimental import enable_hist_gradient_boosting # noqa
97
from sklearn.ensemble import HistGradientBoostingRegressor
108
from sklearn.ensemble import HistGradientBoostingClassifier
119
from sklearn.ensemble._hist_gradient_boosting.binning import _BinMapper

‎sklearn/ensemble/_hist_gradient_boosting/tests/test_gradient_boosting.py

Copy file name to clipboardExpand all lines: sklearn/ensemble/_hist_gradient_boosting/tests/test_gradient_boosting.py
-2Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@
1313
from sklearn.exceptions import NotFittedError
1414
from sklearn.compose import make_column_transformer
1515

16-
# To use this experimental feature, we need to explicitly ask for it:
17-
from sklearn.experimental import enable_hist_gradient_boosting # noqa
1816
from sklearn.ensemble import HistGradientBoostingRegressor
1917
from sklearn.ensemble import HistGradientBoostingClassifier
2018
from sklearn.ensemble._hist_gradient_boosting.loss import _LOSSES

‎sklearn/ensemble/_hist_gradient_boosting/tests/test_monotonic_contraints.py

Copy file name to clipboardExpand all lines: sklearn/ensemble/_hist_gradient_boosting/tests/test_monotonic_contraints.py
-1Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
compute_node_value
1111
)
1212
from sklearn.ensemble._hist_gradient_boosting.histogram import HistogramBuilder
13-
from sklearn.experimental import enable_hist_gradient_boosting # noqa
1413
from sklearn.ensemble import HistGradientBoostingRegressor
1514
from sklearn.ensemble import HistGradientBoostingClassifier
1615

‎sklearn/ensemble/_hist_gradient_boosting/tests/test_warm_start.py

Copy file name to clipboardExpand all lines: sklearn/ensemble/_hist_gradient_boosting/tests/test_warm_start.py
-2Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@
77
from sklearn.base import clone
88
from sklearn.datasets import make_classification, make_regression
99

10-
# To use this experimental feature, we need to explicitly ask for it:
11-
from sklearn.experimental import enable_hist_gradient_boosting # noqa
1210
from sklearn.ensemble import HistGradientBoostingRegressor
1311
from sklearn.ensemble import HistGradientBoostingClassifier
1412
from sklearn.metrics import check_scoring

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.