python - 无法在Python中从statsforecast.models导入Adida

标签 python python-3.x forecasting

我试图在 python 中复制此代码进行统计预测,但遇到了无法加载此模型“adida”形式 statsforecast 库的问题,

这里是引用链接:https://towardsdatascience.com/time-series-forecasting-with-statistical-models-f08dcd1d24d1

import random
from itertools import product
from IPython.display import display, Markdown
from multiprocessing import cpu_count

import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from nixtlats.data.datasets.m4 import M4, M4Info

from statsforecast import StatsForecast
from statsforecast.models import (
    adida, 
    croston_classic, 
    croston_sba, 
    croston_optimized,
    historic_average,
    imapa,
    naive,
    random_walk_with_drift, 
    seasonal_exponential_smoothing,
    seasonal_naive, 
    seasonal_window_average,
    ses, 
    tsb,
    window_average
)

附件是错误消息,您能看一下这个并告诉我为什么导入时出现问题吗?

下面给出的是错误图像:

enter image description here

最佳答案

我做了一些研究,发现问题可能与版本有关,请尝试安装此特定版本的 statsforecast

pip install statsforecasts==0.6.0

之后尝试加载这些模型,希望这能起作用。

关于python - 无法在Python中从statsforecast.models导入Adida,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/73827871/

相关文章:

python - 如何在 urwid 中创建嵌套列表框?

r - 神经网络时间序列预测 tsDyn nnetTS

r - ARIMA 常数的标准误差

python - 在action_default_fallback中调用Chatgpt

python - 数据框到json文件

Python SQLAlchemy 类型错误 : unhashable type: 'dict' when trying to instantiate model with one-to-many relationship

python - 使用 BeautifulSoup python 3.6 抓取数据时缺少网页值

python - 将 DataFrame 中的值插入另一个 DataFrame

c# - 将字节作为参数传递给 c#?

python - Pandas 数据帧上的滞后数据