2

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)

enter image description hereenter image description here

my df looks like this:

enter image description here

Salio
  • 1,058
  • 10
  • 21
Yaovi
  • 61
  • 9

4 Answers4

1

You need to see the type of your data by using

df.dtypes

check the type of ds that should be

ds        datetime64[ns] 
0

Try converting the ds column to datetime manually outside pycaret before feeding to setup. That should hopefully resolve the issue.

Nikhil Gupta
  • 1,436
  • 12
  • 15
0

You can set solve this by setting the dataframe's date frequency.

For example, to set business day frequency use:

df= df.asfreq('B')
Mohamed Eshra
  • 53
  • 1
  • 4
0

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

pip install --pre pycaret

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.

Nikhil Gupta
  • 1,436
  • 12
  • 15