ValueError:您必须传递一个频率参数,因为当前索引没有
我正在使用 pycaret.time_series alpha 模块,但我在启动实验时遇到了这个问题。我认为这是模块内部的。有人可以帮忙吗?
`from pycaret.time_series import *
exp_name = setup(data = df ,index='ds', target='y', fold = 5, fh = 15)`
我得到了这个:
ValueError Traceback(最近调用 最后)c:\ Users \ elsem \ Python \ Andre_Coach \ ts.ipynb Cell 46' in <单元格 行:1>() ----> 1 exp_name = setup(data = df,index='ds', target='y', Fold = 5, fh = 15)
我的 df 看起来像这样:
I'm using pycaret.time_series alpha module but I have this problem avec launching my experiment. I think this is internal to the module. Can anyone help ?
`from pycaret.time_series import *
exp_name = setup(data = df ,index='ds', target='y', fold = 5, fh = 15)`
and i got this :
ValueError Traceback (most recent call
last) c:\Users\elsem\Python\Andre_Coach\ts.ipynb Cell 46' in <cell
line: 1>()
----> 1 exp_name = setup(data = df ,index='ds', target='y', fold = 5, fh = 15)
my df looks like this:
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
来查看数据的类型
您需要通过使用检查 ds 的类型
You need to see the type of your data by using
check the type of ds that should be
在提供给设置之前,尝试在 pycaret 外部手动将 ds 列转换为日期时间。这应该有望解决问题。
Try converting the
ds
column to datetime manually outside pycaret before feeding to setup. That should hopefully resolve the issue.您可以通过设置数据框的日期频率来解决此问题。
例如,要设置工作日频率,请使用:
You can set solve this by setting the dataframe's date frequency.
For example, to set business day frequency use:
首先,您不应该再使用 pycaret-ts-alpha 库,因为它已经过时且已弃用。相反,您现在可以使用 pycaret 的预发布版本,它集成了时间序列模块。
要解决您遇到的特定问题,请尝试按上述设置频率。或者,如果您的数据缺少索引值(例如,沃尔玛数据集缺少某些商店部门组合的值),请尝试将这些索引添加到数据中并将它们输入到 pycaret 中。
First of all, you should not use the pycaret-ts-alpha library anymore as it is old and deprecated. Instead, you can use the pre-release version of pycaret now which has the time series module integrated
To solve the particular problem you have, try setting the frequency as mentioned. Alternately, if you data has missing index values (e.g. the walmart data set has missing values for some store-dept combinations), try adding these indices to the data and imputing them in pycaret.
我遇到了同样的问题,这就是我解决它的方法:
并且设置参数将通过删除
index="ds"
进行相应更改,如下所示:这适用于 pycaret==3.1.0
I had the same issue, and this is how I could solve it :
and setup arguments will alter accordingly by removing
index="ds"
as follows :this works with pycaret==3.1.0