Nixtla / neuralforecast

Scalable and user friendly neural :brain: forecasting algorithms.
https://nixtlaverse.nixtla.io/neuralforecast
Apache License 2.0
3.07k stars 355 forks source link

Error while calling NeuralForecast.predict() method #748

Closed srimantacse closed 1 year ago

srimantacse commented 1 year ago

What happened + What you expected to happen

Got the below error while calling the predict method.

Addition/subtraction of integers and integer-arrays with Timestamp is no longer supported. Instead of adding/subtracting n, use n * obj.freq

Future date is looking like as follows ds unique_id 0 2023-08-19 00:00:00 1 1 2023-08-19 00:15:00 1 2 2023-08-19 00:30:00 1 3 2023-08-19 00:45:00 1 4 2023-08-19 01:00:00 1 .. ... ... 187 2023-08-20 22:45:00 1 188 2023-08-20 23:00:00 1 189 2023-08-20 23:15:00 1 190 2023-08-20 23:30:00 1 191 2023-08-20 23:45:00 1

Versions / Dependencies

1.6.3

Reproduction script

_df = df_train[['ds', 'y']] _df['unique_id'] = [1] * _df.shape[0]

horizon = 192

models = [NBEATS(input_size=no_of_forecasting_points, h=horizon, max_steps=50)] nf = NeuralForecast(models=models, freq='15T') nf.fit(df=_df)

_d_test['unique_id'] = [1] * 192 print(_d_test) forecast = nf.predict(futr_df= _d_test, verbose=True).reset_index().values

Issue Severity

None

srimantacse commented 1 year ago

It was my mistake. Able to debug