1

我正在尝试导入 dask_searchcv 并在导入其他模块时引发错误DeprecationDict

我已经安装了 dask_searchcv 版本:0.2.0 和 scikit-learn 版本:0.21.3

我尝试导入 dark_searchcv,如下所示:

import dask_searchcv as dcv

我收到以下错误消息:

ImportError                               Traceback (most recent call last)
<ipython-input-19-b8082b897401> in <module>
      1 # Instantiate the grid search model
----> 2 import dask_searchcv as dcv
      3 # grid_search = dcv.GridSearchCV(estimator = rf, param_grid = param_grid, cv = 3)
      4 # grid_search.fit(data, target)
      5 # grid_search.best_params_

~/.virtualenvs/dask-test/lib/python3.6/site-packages/dask_searchcv/__init__.py in <module>
      1 from __future__ import absolute_import
      2 
----> 3 from .model_selection import GridSearchCV, RandomizedSearchCV
      4 
      5 from ._version import get_versions

~/.virtualenvs/dask-test/lib/python3.6/site-packages/dask_searchcv/model_selection.py in <module>
     52 
     53 if _SK_VERSION >= '0.19.1':
---> 54     from sklearn.utils.deprecation import DeprecationDict
     55     _RETURN_TRAIN_SCORE_DEFAULT = 'warn'
     56 

ImportError: cannot import name 'DeprecationDict'

我尝试使用重新安装 sklearn,pip3 install -U scikit-learn但问题仍未解决。

注意:我正在使用 jupyter notebook 运行上面的代码

4

1 回答 1

2

dask-searchcv已弃用,如文档中所述:https ://dask-searchcv.readthedocs.io/en/latest/

您想要dask-ml并且应该将导入更新为import dask_ml.model_selection as dcv.

于 2019-08-27T19:33:25.970 回答