Core Module Documentation

neuralprophet.plot_forecast.plot(fcst, ax=None, xlabel='ds', ylabel='y', highlight_forecast=None, line_per_origin=False, figsize=(10, 6))

Plot the NeuralProphet forecast

Parameters
  • fcst (pd.DataFrame) – output of m.predict.

  • ax (matplotlib axes) – on which to plot.

  • xlabel (str) – label name on X-axis

  • ylabel (str) – label name on Y-axis

  • highlight_forecast (int) – i-th step ahead forecast to highlight.

  • line_per_origin (bool) – print a line per forecast of one per forecast age

  • figsize (tuple) – width, height in inches.

Returns

A matplotlib figure.

neuralprophet.plot_forecast.plot_components(m, fcst, forecast_in_focus=None, one_period_per_season=True, residuals=False, figsize=None)

Plot the NeuralProphet forecast components.

Parameters
  • m (NeuralProphet) – fitted model.

  • fcst (pd.DataFrame) – output of m.predict.

  • forecast_in_focus (int) – n-th step ahead forecast AR-coefficients to plot

  • one_period_per_season (bool) – plot one period per season instead of the true seasonal components of the forecast.

  • figsize (tuple) – width, height in inches. None (default): automatic (10, 3 * npanel)

Returns

A matplotlib figure.

neuralprophet.plot_forecast.plot_forecast_component(fcst, comp_name, plot_name=None, ax=None, figsize=(10, 6), multiplicative=False, bar=False, rolling=None, add_x=False)

Plot a particular component of the forecast.

Parameters
  • fcst (pd.DataFrame) – output of m.predict.

  • comp_name (str) – Name of the component to plot.

  • plot_name (str) – Name of the plot Title.

  • ax (matplotlib axis) – matplotlib Axes to plot on.

  • figsize (tuple) – width, height in inches. Ignored if ax is not None. default: (10, 6)

  • multiplicative (bool) – set y axis as percentage

  • bar (bool) – make barplot

  • rolling (int) – rolling average underplot

  • add_x (bool) – add x symbols to plotted points

Returns

a list of matplotlib artists

neuralprophet.plot_forecast.plot_multiforecast_component(fcst, comp_name, plot_name=None, ax=None, figsize=(10, 6), multiplicative=False, bar=False, focus=1, num_overplot=None)

Plot a particular component of the forecast.

Parameters
  • fcst (pd.DataFrame) – output of m.predict.

  • comp_name (str) – Name of the component to plot.

  • plot_name (str) – Name of the plot Title.

  • ax (matplotlib axis) – matplotlib Axes to plot on.

  • figsize (tuple) – width, height in inches. Ignored if ax is not None. default: (10, 6)

  • multiplicative (bool) – set y axis as percentage

  • bar (bool) – make barplot

  • focus (int) – forecast number to portray in detail.

  • num_overplot (int) – overplot all forecasts up to num None (default): only plot focus

Returns

a list of matplotlib artists