1

I get this error when I try to use an example from sktime documentation.

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)

The error that I get is this:

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)

Any ideas on how to deal with this error?

I tried uninstalling and then installing again the sklean and scikit-learn but did not work.

mloning
  • 825
  • 7
  • 18
msh855
  • 1,493
  • 1
  • 15
  • 36

0 Answers0