python-3.x - sktime 错误无法从“sklearn.utils.fixes”导入名称“_take_along_axis”
问题描述
当我尝试使用 sktime 文档中的示例时出现此错误。
MWE
from sktime.datasets import load_airline
from sktime.forecasting.model_selection import (
ExpandingWindowSplitter,
ForecastingGridSearchCV,
ExpandingWindowSplitter)
from sktime.forecasting.naive import NaiveForecaster
y = load_airline()
fh = [1,2,3]
cv = ExpandingWindowSplitter(
start_with_window=True,
fh=fh)
forecaster = NaiveForecaster()
param_grid = {"strategy" : ["last", "mean", "drift"]}
gscv = ForecastingGridSearchCV(
forecaster=forecaster,
param_grid=param_grid,
cv=cv)
gscv.fit(y)
y_pred = gscv.predict(fh)
我得到的错误是这样的:
cannot import name '_take_along_axis' from 'sklearn.utils.fixes' (/Users/xxxxx/opt/anaconda3/envs/Spyder_env/lib/python3.8/site-packages/sklearn/utils/fixes.py)
有关如何处理此错误的任何想法?
我尝试卸载然后再次安装 sklean 和 scikit-learn 但没有工作。
解决方案
推荐阅读
- c# - 从 Random.Range 中排除值
- angular - Angular 不能将异步管道与我的 observable 一起使用
- angular - 为 HTML 文件配置 Prettier
- c# - 如何使用 .net 核心中的 C# mongo Db 驱动程序将多个文档组合/合并到一个 c# 对象
- sql - postgres 访问视图内的 cte
- c - 是否有非循环无符号 32 位整数平方根函数 C
- amazon-web-services - 在从 S3 存储桶中读取许多小对象时,Boto 3 比 boto 2 慢得多
- c# - 尝试在 VC# 2017 中安装 emgu.CV.runtime.windows 时出现 Emgu 错误
- openssl - 私钥:将有效的 EC 密钥转换为等效的 RSA 密钥
- python - 遍历 Dataframe 列