Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions python/cuml/cuml/dask/ensemble/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ def _create_model(
)
self.workers = workers
self._set_internal_model(None)
# rapids-pre-commit-hooks: disable-next-line
# TODO(26.08): Drop along with the single-GPU deprecation in
# cuml.ensemble.randomforest_common.
# Record whether the user explicitly set `max_depth`; the warning is
Expand Down Expand Up @@ -100,11 +101,13 @@ def _estimators_per_worker(self, n_estimators):
return n_estimators_per_worker

def _fit(self, model, dataset, convert_dtype, broadcast_data):
# rapids-pre-commit-hooks: disable-next-line
# TODO(26.08): Drop along with the single-GPU deprecation in
# cuml.ensemble.randomforest_common.
if not getattr(self, "_max_depth_user_set", True):
warnings.warn(
"The default value of 'max_depth' will change from 16 to "
# rapids-pre-commit-hooks: disable-next-line
"None (unlimited depth) in release 26.08. To suppress this "
"warning, set 'max_depth' explicitly.",
FutureWarning,
Expand Down Expand Up @@ -252,6 +255,7 @@ def _get_params(self, deep):
return params_of_each_model

def _set_params(self, **params):
# rapids-pre-commit-hooks: disable-next-line
# TODO(26.08): Drop along with the single-GPU deprecation in
# cuml.ensemble.randomforest_common.
if "max_depth" in params:
Expand Down
1 change: 1 addition & 0 deletions python/cuml/cuml/dask/ensemble/randomforestclassifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ class RandomForestClassifier(
.. note:: This default differs from scikit-learn's
random forest, which defaults to unlimited depth.

.. rapids-pre-commit-hooks: disable-next-line
.. versionchanged:: 26.08
The default of `max_depth` will change from `16` to `None`.
max_leaves : int (default = -1)
Expand Down
1 change: 1 addition & 0 deletions python/cuml/cuml/dask/ensemble/randomforestregressor.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ class RandomForestRegressor(
.. note:: This default differs from scikit-learn's
random forest, which defaults to unlimited depth.

.. rapids-pre-commit-hooks: disable-next-line
.. versionchanged:: 26.08
The default of `max_depth` will change from `16` to `None`.
max_leaves : int (default = -1)
Expand Down
1 change: 1 addition & 0 deletions python/cuml/cuml/ensemble/randomforest_common.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,7 @@ class BaseRandomForestModel(Base, InteropMixin):
if max_depth == _DEPRECATED_MAX_DEPTH_DEFAULT:
warnings.warn(
"The default value of 'max_depth' will change from 16 to "
# rapids-pre-commit-hooks: disable-next-line
"None (unlimited depth) in release 26.08. To suppress this "
"warning, set 'max_depth' explicitly.",
FutureWarning, stacklevel=3)
Expand Down
1 change: 1 addition & 0 deletions python/cuml/cuml/ensemble/randomforestclassifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ class RandomForestClassifier(BaseRandomForestModel, ClassifierMixin):
.. note:: This default differs from scikit-learn's random forest,
which defaults to unlimited depth.

.. rapids-pre-commit-hooks: disable-next-line
.. versionchanged:: 26.08
The default of `max_depth` will change from `16` to `None`.
max_leaves : int (default = -1)
Expand Down
1 change: 1 addition & 0 deletions python/cuml/cuml/ensemble/randomforestregressor.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ class RandomForestRegressor(BaseRandomForestModel, RegressorMixin):
.. note:: This default differs from scikit-learn's random forest,
which defaults to unlimited depth.

.. rapids-pre-commit-hooks: disable-next-line
.. versionchanged:: 26.08
The default of `max_depth` will change from `16` to `None`.
max_leaves : int (default = -1)
Expand Down
1 change: 1 addition & 0 deletions python/cuml/tests/dask/test_dask_random_forest.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
from cuml.ensemble import RandomForestClassifier as cuRFC_sg
from cuml.ensemble import RandomForestRegressor as cuRFR_sg

# rapids-pre-commit-hooks: disable-next-line
# TODO(26.08): Remove this filter
pytestmark = pytest.mark.filterwarnings(
"ignore:The default value of 'max_depth':FutureWarning"
Expand Down
1 change: 1 addition & 0 deletions python/cuml/tests/explainer/test_explainer_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
)
from cuml.testing.utils import ClassEnumerator

# rapids-pre-commit-hooks: disable-next-line
# TODO(26.08) Remove this filter
pytestmark = pytest.mark.filterwarnings(
"ignore:The default value of 'max_depth':FutureWarning"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
from cuml.testing.datasets import with_dtype
from cuml.testing.utils import ClassEnumerator, get_shap_values

# rapids-pre-commit-hooks: disable-next-line
# TODO(26.08): Remove this filter
pytestmark = pytest.mark.filterwarnings(
"ignore:The default value of 'max_depth':FutureWarning"
Expand Down
2 changes: 2 additions & 0 deletions python/cuml/tests/explainer/test_gpu_treeshap.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
shap = pytest.importorskip("shap")


# rapids-pre-commit-hooks: disable-next-line
# TODO(26.08): Remove this filter
pytestmark = pytest.mark.filterwarnings(
"ignore:The default value of 'max_depth':FutureWarning"
Expand Down Expand Up @@ -929,6 +930,7 @@ def check_efficiency_interactions(expected_value, pred, shap_values):
)


# rapids-pre-commit-hooks: disable-next-line
# TODO(26.08): Can inline this back within the `example` call
with warnings.catch_warnings():
warnings.filterwarnings("ignore")
Expand Down
1 change: 1 addition & 0 deletions python/cuml/tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ def test_mro(model):
@pytest.mark.parametrize("model_name", list(models.keys()))
# ignore random forest float64 warnings and max_depth deprecation
@pytest.mark.filterwarnings("ignore:To use pickling or GPU-based")
# rapids-pre-commit-hooks: disable-next-line
# TODO(26.08): Remove this filter
@pytest.mark.filterwarnings("ignore:The default value of 'max_depth'")
def test_fit_function(dataset, model_name):
Expand Down
4 changes: 4 additions & 0 deletions python/cuml/tests/test_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ def get_param_doc(param_doc_obj, name: str):
@pytest.mark.parametrize("child_class", list(all_base_children.keys()))
# ignore ColumnTransformer init warning and max_depth deprecation
@pytest.mark.filterwarnings("ignore:Transformers are required")
# rapids-pre-commit-hooks: disable-next-line
# TODO(26.08) Remove this filter
@pytest.mark.filterwarnings("ignore:The default value of 'max_depth'")
@pytest.mark.filterwarnings("ignore::FutureWarning")
Expand Down Expand Up @@ -231,6 +232,7 @@ def test_common_signatures(cls, method):
first = ["self", "X", "y"]
if "sample_weight" in sig.parameters:
first.append("sample_weight")
# rapids-pre-commit-hooks: disable-next-line
# TODO(26.08): remove "deprecated"
assert sig.parameters["sample_weight"].default in (
None,
Expand Down Expand Up @@ -300,6 +302,7 @@ def test_get_handle_device_ids():
and hasattr(cls, "predict")
],
)
# rapids-pre-commit-hooks: disable-next-line
# TODO(26.08) Remove this filter
@pytest.mark.filterwarnings("ignore:The default value of 'max_depth'")
def test_regressor_predict_dtype(cls):
Expand Down Expand Up @@ -341,6 +344,7 @@ def test_regressor_predict_dtype(cls):
(cuml.naive_bayes.MultinomialNB, None),
],
)
# rapids-pre-commit-hooks: disable-next-line
# TODO(26.08) Remove this filter
@pytest.mark.filterwarnings("ignore:The default value of 'max_depth'")
@pytest.mark.parametrize(
Expand Down
1 change: 1 addition & 0 deletions python/cuml/tests/test_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
],
)
@pytest.mark.filterwarnings("ignore:The number of bins.*:UserWarning")
# rapids-pre-commit-hooks: disable-next-line
# TODO(26.08) Remove this filter
@pytest.mark.filterwarnings("ignore:The default value of 'max_depth'")
def test_random_state_argument(Estimator):
Expand Down
1 change: 1 addition & 0 deletions python/cuml/tests/test_fil.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
unit_param,
)

# rapids-pre-commit-hooks: disable-next-line
# TODO(26.08): Remove this filter
pytestmark = pytest.mark.filterwarnings(
"ignore:The default value of 'max_depth':FutureWarning"
Expand Down
1 change: 1 addition & 0 deletions python/cuml/tests/test_meta_estimators.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
from cuml.svm import SVC
from cuml.testing.utils import ClassEnumerator

# rapids-pre-commit-hooks: disable-next-line
# TODO(26.08): Remove this filter
pytestmark = pytest.mark.filterwarnings(
"ignore:The default value of 'max_depth':FutureWarning"
Expand Down
1 change: 1 addition & 0 deletions python/cuml/tests/test_pickle.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
)
from cuml.tsa.arima import ARIMA

# rapids-pre-commit-hooks: disable-next-line
# TODO(26.08) Remove this filter
pytestmark = pytest.mark.filterwarnings(
"ignore:The default value of 'max_depth':FutureWarning"
Expand Down
1 change: 1 addition & 0 deletions python/cuml/tests/test_random_forest.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
from cuml.metrics import r2_score
from cuml.testing.utils import quality_param, stress_param, unit_param

# rapids-pre-commit-hooks: disable-next-line
# TODO(26.08): Remove this filter
pytestmark = pytest.mark.filterwarnings(
"ignore:The default value of 'max_depth':FutureWarning"
Expand Down
1 change: 1 addition & 0 deletions python/cuml/tests/test_sklearn_compatibility.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@
ElasticNet(),
Lasso(),
LinearRegression(),
# rapids-pre-commit-hooks: disable-next-line
# TODO(26.08): Remove explicit default
RandomForestClassifier(max_depth=None),
RandomForestRegressor(max_depth=None),
Expand Down
Loading