Has anyone gotten this error: "ImportError: canno...
# general
g
Has anyone gotten this error: "ImportError: cannot import name 'naive' from 'statsforecast.models' (/local_disk0/.ephemeral_nfs/envs/pythonEnv-230a87f5-7353-4abc-a244-a806abd865a8/lib/python3.8/site-packages/statsforecast/models.py)"
👀 3
f
hi @Ginger Holt! The problem probably arises from the update of the models that we made from version 1.0.0. Before that version, the models followed a functional paradigm. The most recent version uses classes with
fit
and
predict
methods (like sklearn). So, to import naive the new line would be:
Copy code
from statsforecast.models import Naive
The list of current models can be found here: https://nixtla.github.io/statsforecast/models.html Did the error arise in any of the examples? We are updating them to consider the new version. :)
g
Thanks for the quick response and detailed explanation! I was trying to reproduce the example in https://github.com/Nixtla/hierarchicalforecast/blob/41840924e1966704a4bed323e7e917862248c27c/examples/TourismSmall.ipynb when I got the error. There was also an issue with importing auto_arima.
Copy code
from statsforecast.models import auto_arima, naive
f
I see, the new version of that notebook can be found here: https://github.com/Nixtla/hierarchicalforecast/blob/main/nbs/examples/TourismSmall.ipynb. It works with the latest version of statsforecast
g
Thank you @fede (nixtla) (they/them)!