Avi
07/12/2023, 8:24 PMmodels = [NHITS(h=horizon,
input_size=2*horizon,
hist_exog_list = cols)]
nf = NeuralForecast(
models=models,
freq='M')
Y_hat_df = nf.fit(df=data, val_size=36,)
I am getting this error while fitting the model
InvalidIndexError: Reindexing only valid with uniquely valued Index objects
Can you please tell me what I am doing wrong here.Cristian (Nixtla)
07/12/2023, 8:29 PMunique_id
and ds
, this should be unique.
2. cols
is not a list. I am not sure it will work if you did data.columns
because it is an Index object. You should convert it to a list: list(data.columns)
(only include exogenous columns).
You also have an extra ,
at the end of the fit
method.
Can you try removing the hist_exog_list
? Run the exact same pipeline, with the same data
, but do hist_exog_list=None
. It would help to debug if the error is caused by the exogenous variables. Dont remove them from the data
.Avi
07/12/2023, 8:57 PMCristian (Nixtla)
07/12/2023, 8:58 PMAvi
07/12/2023, 9:02 PMCristian (Nixtla)
07/12/2023, 9:03 PMhist_exog_list
?Avi
07/12/2023, 9:03 PMCristian (Nixtla)
07/12/2023, 9:04 PMAvi
07/12/2023, 9:04 PMCristian (Nixtla)
07/12/2023, 9:06 PMAvi
07/12/2023, 9:06 PMCristian (Nixtla)
07/12/2023, 9:08 PMunique_id
, ds
, y
? the error is very clear in that you have two columns with the same nameAvi
07/12/2023, 9:16 PMCristian (Nixtla)
07/12/2023, 9:24 PMhist_exog_list
in the config
when you define the search