NeuralProphet - Quick Start

Installing

NeuralProphet can be installed with pip:

$ pip install neuralprophet

If you plan to use the package in a Jupyter notebook, we recommend to install the ‘live’ version:

$ pip install neuralprophet[live]

Alternatively, you can get the most up to date version by cloning directly from GitHub:

$ git clone https://github.com/ourownstory/neural_prophet.git
$ cd neural_prophet
$ pip install .

Simple Model

The input data should have two columns, ds which has the timestamps and y column which contains the observed values of the time series.

from neuralprophet import NeuralProphet
import pandas as pd

data_location = "https://raw.githubusercontent.com/ourownstory/neuralprophet-data/main/datasets/"

df = pd.read_csv(data_location + 'wp_log_peyton_manning.csv')

To setup a simple NeuralProphet model, create an object of the NeuralProphet class as follows and call the fit function. Frequency is automatically detected 😉

m = NeuralProphet()
metrics = m.fit(df)

Now we can simple make predictions using this fitted model by creating a future dataframe and setting the forecast horizon via the functional argument periods:

future = m.make_future_dataframe(df=df, periods=365)
forecast = m.predict(df=future)

Next, we obtain the forecast and visualize our data… et voila 👩🏼‍🎨

fig_forecast = m.plot(forecast)
_images/plot_forecast_simple_model_1.png

Note

Congrats! 🥳 You successfully trained your first NeuralProphet model! Checkout the Full Simple Model description for additional basic features of NeuralProphet. 🚀

Get started with Tutorials