我试图用PYTHON复制这个统计数据预测的代码,我遇到了无法从统计数据预测库中加载这个模型的问题,

以下是供参考的链接: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

推荐答案

我做了一些研究,发现问题可能出在版本上,try 安装这个特定版本的statsForecast

pip install statsforecasts==0.6.0

在那之后try 加载这些模型,希望这应该能起作用.

Python相关问答推荐

按顺序合并2个词典列表

如何使用根据其他值相似的列从列表中获取的中间值填充空NaN数据

PyQt5,如何使每个对象的 colored颜色 不同?'

Pre—Commit MyPy无法禁用非错误消息

不允许访问非IPM文件夹

从Windows Python脚本在WSL上运行Linux应用程序

lityter不让我输入左边的方括号,'

幂集,其中每个元素可以是正或负""""

在Python中使用yaml渲染(多行字符串)

如何删除重复的文字翻拍?

如何在Python中将超链接添加到PDF中每个页面的顶部?

我怎么才能用拉夫分拣呢?

设置索引值每隔17行左右更改的索引

Polars定制函数返回多列

查找数据帧的给定列中是否存在特定值

使用美汤对维基百科表格进行网络刮擦未返回任何内容

GEKKO中若干参数的线性插值动态优化

滑动子数组美容工作在IDE上,但不是在leetcode上

获取每行NumPy最大出现次数的所有值

如何使用Pillow基于二进制掩码设置PNG的RGB值