diff --git a/ops/conda_env/macos_cpu_test.yml b/ops/conda_env/macos_cpu_test.yml index 8d2d2c9591c1..29ff99e3504f 100644 --- a/ops/conda_env/macos_cpu_test.yml +++ b/ops/conda_env/macos_cpu_test.yml @@ -11,7 +11,7 @@ dependencies: - numpy - scipy - llvm-openmp -- scikit-learn>=1.4.1,<=1.5.2 +- scikit-learn>=1.4.1 - pandas - matplotlib - dask<=2024.10.0 diff --git a/ops/conda_env/win64_test.yml b/ops/conda_env/win64_test.yml index 2260c521f889..32b9339e6fc0 100644 --- a/ops/conda_env/win64_test.yml +++ b/ops/conda_env/win64_test.yml @@ -6,7 +6,7 @@ dependencies: - numpy - scipy - matplotlib -- scikit-learn<=1.5.2 +- scikit-learn - pandas - pytest - boto3 diff --git a/python-package/xgboost/dask/__init__.py b/python-package/xgboost/dask/__init__.py index b2fc191f1c02..345c7ccc990d 100644 --- a/python-package/xgboost/dask/__init__.py +++ b/python-package/xgboost/dask/__init__.py @@ -1616,7 +1616,7 @@ def _client_sync(self, func: Callable, **kwargs: Any) -> Any: @xgboost_model_doc( """Implementation of the Scikit-Learn API for XGBoost.""", ["estimators", "model"] ) -class DaskXGBRegressor(DaskScikitLearnBase, XGBRegressorBase): +class DaskXGBRegressor(XGBRegressorBase, DaskScikitLearnBase): """dummy doc string to workaround pylint, replaced by the decorator.""" async def _fit_async( @@ -1707,7 +1707,7 @@ def fit( "Implementation of the scikit-learn API for XGBoost classification.", ["estimators", "model"], ) -class DaskXGBClassifier(DaskScikitLearnBase, XGBClassifierBase): +class DaskXGBClassifier(XGBClassifierBase, DaskScikitLearnBase): # pylint: disable=missing-class-docstring async def _fit_async( self, @@ -1911,7 +1911,7 @@ def _argmax(x: Any) -> Any: For the dask implementation, group is not supported, use qid instead. """, ) -class DaskXGBRanker(DaskScikitLearnBase, XGBRankerMixIn): +class DaskXGBRanker(XGBRankerMixIn, DaskScikitLearnBase): @_deprecate_positional_args def __init__( self, diff --git a/tests/python-gpu/test_gpu_prediction.py b/tests/python-gpu/test_gpu_prediction.py index ea9dade9673e..d1005b2014db 100644 --- a/tests/python-gpu/test_gpu_prediction.py +++ b/tests/python-gpu/test_gpu_prediction.py @@ -477,7 +477,7 @@ def test_predict_leaf_dart(self, param: dict, dataset: tm.TestDataset) -> None: ) @settings(deadline=None, max_examples=20, print_blob=True) def test_predict_categorical_split(self, df): - from sklearn.metrics import mean_squared_error + from sklearn.metrics import root_mean_squared_error df = df.astype("category") x0, x1 = df["x0"].to_numpy(), df["x1"].to_numpy() @@ -504,7 +504,7 @@ def test_predict_categorical_split(self, df): ) bst.set_param({"device": "cuda:0"}) pred = bst.predict(dtrain) - rmse = mean_squared_error(y_true=y, y_pred=pred, squared=False) + rmse = root_mean_squared_error(y_true=y, y_pred=pred) np.testing.assert_almost_equal( rmse, eval_history["train"]["rmse"][-1], decimal=5 )