首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >pycaret.time_series.TSForecastingExperiment ImportError:无法从“sklearn.model_selection._search”导入名称“_check_param_grid”

pycaret.time_series.TSForecastingExperiment ImportError:无法从“sklearn.model_selection._search”导入名称“_check_param_grid”
EN

Stack Overflow用户
提问于 2022-05-13 11:08:38
回答 1查看 1.2K关注 0票数 3

当在databricks中导入 getting时间序列(Beta)模块时,我得到了下面的错误(我们之前运行得很成功)。请你帮忙解决这些问题。

使用中的version版本:

代码语言:javascript
运行
复制
import pycaret
pycaret.__version__  # Out[1]: '3.0.0'

正在使用的python版本:

代码语言:javascript
运行
复制
import sys
sys.version #Out[9]: '3.8.10 (default, Mar 15 2022, 12:22:08) \n[GCC 9.4.0]'

下面是该问题的堆栈跟踪。

代码语言:javascript
运行
复制
from pycaret.time_series import TSForecastingExperiment

/databricks/python_shell/dbruntime/PythonPackageImportsInstrumentation/__init__.py in import_patch(name, globals, locals, fromlist, level)
    160             # Import the desired module. If you’re seeing this while debugging a failed import,
    161             # look at preceding stack frames for relevant error information.
--> 162             original_result = python_builtin_import(name, globals, locals, fromlist, level)
    163 
    164             is_root_import = thread_local._nest_level == 1

/databricks/python/lib/python3.8/site-packages/pycaret/time_series/__init__.py in <module>
----> 1 from pycaret.time_series.forecasting.oop import TSForecastingExperiment
      2 from pycaret.time_series.forecasting.functional import (
      3     setup,
      4     create_model,
      5     compare_models,

/databricks/python_shell/dbruntime/PythonPackageImportsInstrumentation/__init__.py in import_patch(name, globals, locals, fromlist, level)
    160             # Import the desired module. If you’re seeing this while debugging a failed import,
    161             # look at preceding stack frames for relevant error information.
--> 162             original_result = python_builtin_import(name, globals, locals, fromlist, level)
    163 
    164             is_root_import = thread_local._nest_level == 1

/databricks/python/lib/python3.8/site-packages/pycaret/time_series/forecasting/oop.py in <module>
     14 from sklearn.base import clone
     15 from sktime.forecasting.base import ForecastingHorizon
---> 16 from sktime.forecasting.model_selection import (
     17     temporal_train_test_split,
     18     ExpandingWindowSplitter,

/databricks/python_shell/dbruntime/PythonPackageImportsInstrumentation/__init__.py in import_patch(name, globals, locals, fromlist, level)
    160             # Import the desired module. If you’re seeing this while debugging a failed import,
    161             # look at preceding stack frames for relevant error information.
--> 162             original_result = python_builtin_import(name, globals, locals, fromlist, level)
    163 
    164             is_root_import = thread_local._nest_level == 1

/databricks/python/lib/python3.8/site-packages/sktime/forecasting/model_selection/__init__.py in <module>
     20 from sktime.forecasting.model_selection._split import SlidingWindowSplitter
     21 from sktime.forecasting.model_selection._split import temporal_train_test_split
---> 22 from sktime.forecasting.model_selection._tune import ForecastingGridSearchCV
     23 from sktime.forecasting.model_selection._tune import ForecastingRandomizedSearchCV

/databricks/python_shell/dbruntime/PythonPackageImportsInstrumentation/__init__.py in import_patch(name, globals, locals, fromlist, level)
    160             # Import the desired module. If you’re seeing this while debugging a failed import,
    161             # look at preceding stack frames for relevant error information.
--> 162             original_result = python_builtin_import(name, globals, locals, fromlist, level)
    163 
    164             is_root_import = thread_local._nest_level == 1

/databricks/python/lib/python3.8/site-packages/sktime/forecasting/model_selection/_tune.py in <module>
     11 from sklearn.base import clone
     12 from sklearn.model_selection import ParameterGrid, ParameterSampler, check_cv
---> 13 from sklearn.model_selection._search import _check_param_grid
     14 from sklearn.utils.metaestimators import if_delegate_has_method
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2022-05-13 11:20:56

这是由于在sktime依赖项中使用了sklearn的私有方法。自从sklearn更新到1.1.0之后,这个私有方法就被删除/移动了,因此它正在崩溃。sktime团队正在致力于解决这个问题。同时,您可以通过强制安装sklearn 1.0.2来修复这个问题。

请参阅GitHub Repo:https://github.com/pycaret/pycaret/issues/2542中的详细信息

票数 5
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/72228607

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档