Nixtla / neuralforecast

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

NEBEATS forecasts Nan values #824

Closed mak-rayate closed 10 months ago

mak-rayate commented 10 months ago

What happened + What you expected to happen

Issue : Currently using NBEATS lib for forecasting timeseries but I produces all Nan values .

Expecting : It should produce some values .

Versions / Dependencies

neuralforecast 1.6.4

Reproduction script

dataset --> https://www.kaggle.com/datasets/akritiupadhyayks/maunaloadailytemps-dataset df = pd.read_csv('MaunaLoaDailyTemps - Copy.csv') df['unique_id'] = 'H1' df.rename(columns={date_column: 'ds',forecast_col:'y'}, inplace=True) train_data = df[['unique_id','ds','y']] train_data['ds'] = pd.to_datetime(train_data['ds'])

horizon=12 model = [NBEATS(input_size=2*horizon, h=horizon, max_steps=50)] nf = NeuralForecast(models=model, freq='D') nf.fit(df=train_data)

Y_hat_df = nf.predict().reset_index()

Issue Severity

High: It blocks me from completing my task.

jmoralez commented 10 months ago

Hey @mak-rayate, thanks for using neuralforecast. Depending on which column you're using as the target I believe the problem may be that the dataset has some missing values, as you can see here for 5/17/2014 there aren't values for MinTemp, MaxTemp nor AvgTemp, so if you're using any of those the null values are being propagated to the predictions. If you fill those with some other value it should work as expected. image

mak-rayate commented 10 months ago

Thanks @jmoralez , now working as expected . Thanks for response :)