Skip to main content
Dataset input requirements
In this example we will go through the dataset input requirements of the core.NeuralForecast class. The core.NeuralForecast methods operate as global models that receive a set of time series rather than single series. The class uses cross-learning technique to fit flexible-shared models such as neural networks improving its generalization capabilities as shown by the M4 international forecasting competition (Smyl 2019, Semenoglou 2021). You can run these experiments using GPU with Google Colab. Open In Colab

Long format

Multiple time series

Store your time series in a pandas dataframe in long format, that is, each row represents an observation for a specific series and timestamp. Let’s see an example using the datasetsforecast library. Y_df = pd.concat( [series1, series2, ...])
Y_df is a dataframe with three columns: unique_id with a unique identifier for each time series, a column ds with the datestamp and a column y with the values of the series.

Single time series

If you have only one time series, you have to include the unique_id column. Consider, for example, the AirPassengers dataset.
In this example Y_df only contains two columns: timestamp, and value. To use NeuralForecast we have to include the unique_id column and rename the previous ones.

References