Core Module Documentation#

neuralprophet.plot_model_parameters_matplotlib.plot_custom_season(m, comp_name, quantile, ax=None, figsize=(10, 6), df_name='__df__')#

Plot any seasonal component of the forecast.

Parameters
  • m (NeuralProphet) – Fitted model

  • comp_name (str) – Name of seasonality component

  • quantile (float) – The quantile for which the custom season is plotted

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

  • focus (int) – Show weights for this forecast, if provided

  • figsize (tuple) –

    Width, height in inches, ignored if ax is not None.

    Note

    Default value is set to figsize = (10, 6)

  • df_name (str) –

    Name of dataframe to refer to data params from original keys of train dataframes

    Note

    Only used for local normalization in global modeling

Returns

List of Artist objects containing seasonal forecast component

Return type

matplotlib.artist.Artist

neuralprophet.plot_model_parameters_matplotlib.plot_daily(m, quantile, comp_name='daily', quick=True, ax=None, figsize=(10, 6), df_name='__df__')#

Plot the daily component of the forecast.

Parameters
  • m (NeuralProphet) – Fitted model

  • quantile (float) – The quantile for which the daily seasonality is plotted

  • comp_name (str) – Name of seasonality component if previously changed from default daily

  • quick (bool) – Use quick low-level call of model

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

  • figsize (tuple) –

    Width, height in inches, ignored if ax is not None.

    Note

    Default value is set to figsize = (10, 6)

  • df_name (str) –

    Name of dataframe to refer to data params from original keys of train dataframes

    Note

    Only used for local normalization in global modeling

Returns

List of Artist objects containing weekly forecast component

Return type

matplotlib.artist.Artist

neuralprophet.plot_model_parameters_matplotlib.plot_lagged_weights(weights, comp_name, focus=None, ax=None, figsize=(10, 6))#

Make a barplot of the importance of lagged inputs.

Parameters
  • weights (list) – tuples of (name, weights)

  • comp_name (str) – Name of lagged inputs

  • focus (int) – Show weights for this forecast, if provided

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

  • figsize (tuple) –

    Width, height in inches, ignored if ax is not None.

    Note

    Default value is set to figsize = (10, 6)

Returns

List of Artist objects containing barplot

Return type

matplotlib.artist.Artist

neuralprophet.plot_model_parameters_matplotlib.plot_parameters(m, plot_configuration, quantile=0.5, weekly_start=0, yearly_start=0, figsize=None, df_name=None, forecast_in_focus=None)#

Plot the parameters that the model is composed of, visually.

Parameters
  • m (NeuralProphet) – Fitted model

  • plot_configuration (dict) – dict of configured parameters to plot

  • quantile (float) – The quantile for which the model parameters are to be plotted

  • weekly_start (int) –

    Specifying the start day of the weekly seasonality plot

    Options
    • (default) weekly_start = 0: starts the week on Sunday

    • weekly_start = 1: shifts by 1 day to Monday, and so on

  • yearly_start (int) –

    Specifying the start day of the yearly seasonality plot.

    Options
    • (default) yearly_start = 0: starts the year on Jan 1

    • yearly_start = 1: shifts by 1 day to Jan 2, and so on

  • figsize (tuple) –

    Width, height in inches.

    Note

    Default value is set to None -> automatic figsize = (10, 3 * npanel)

  • df_name (str) –

    Name of dataframe to refer to data params from original keys of train dataframes

    Note

    Only used for local normalization in global modeling

  • forecast_in_focus (int) –

    optinal, i-th step ahead forecast to plot

    Note

    None (default): plot self.highlight_forecast_step_n by default

Returns

Figure showing the NeuralProphet parameters

Return type

matplotlib.pyplot.figure

Examples

Base usage of plot_parameters()

>>> from neuralprophet import NeuralProphet
>>> m = NeuralProphet()
>>> metrics = m.fit(df, freq="D")
>>> future = m.make_future_dataframe(df=df, periods=365)
>>> forecast = m.predict(df=future)
>>> m.plot_parameters()
neuralprophet.plot_model_parameters_matplotlib.plot_scalar_weights(weights, plot_name, focus=None, ax=None, figsize=(10, 6))#

Make a barplot of the regressor weights.

Parameters
  • weights (list) – tuples of (name, weights)

  • plot_name (str) – Name of the plot Title

  • focus (int) – Show weights for this forecast, if provided

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

  • figsize (tuple) –

    Width, height in inches, ignored if ax is not None.

    Note

    Default value is set to figsize = (10, 6)

Returns

List of Artist objects containing barplot

Return type

matplotlib.artist.Artist

neuralprophet.plot_model_parameters_matplotlib.plot_trend(m, quantile, ax=None, plot_name='Trend', figsize=(10, 6), df_name='__df__')#

Make a barplot of the magnitudes of trend-changes.

Parameters
  • m (NeuralProphet) – Fitted model

  • quantile (float) – The quantile for which the trend changes are plotted

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

  • plot_name (str) – Name of the plot Title

  • figsize (tuple) –

    Width, height in inches, ignored if ax is not None.

    Note

    Default value is set to figsize = (10, 6)

  • df_name (str) –

    Name of dataframe to refer to data params from original keys of train dataframes

    Note

    Only used for local normalization in global modeling

Returns

List of Artist objects containing barplot

Return type

matplotlib.artist.Artist

neuralprophet.plot_model_parameters_matplotlib.plot_trend_change(m, quantile, ax=None, plot_name='Trend Change', figsize=(10, 6), df_name='__df__')#

Make a barplot of the magnitudes of trend-changes.

Parameters
  • m (NeuralProphet) – Fitted model

  • quantile (float) – The quantile for which the trend changes are plotted

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

  • plot_name (str) – Name of the plot Title

  • figsize (tuple) –

    Width, height in inches, ignored if ax is not None.

    Note

    Default value is set to figsize = (10, 6)

  • df_name (str) –

    Name of dataframe to refer to data params from original keys of train dataframes

    Note

    Only used for local normalization in global modeling

Returns

List of Artist objects containing barplot

Return type

matplotlib.artist.Artist

neuralprophet.plot_model_parameters_matplotlib.plot_weekly(m, quantile, comp_name='weekly', weekly_start=0, quick=True, ax=None, figsize=(10, 6), df_name='__df__')#

Plot the weekly component of the forecast.

Parameters
  • m (NeuralProphet) – Fitted model

  • quantile (float) – The quantile for which the weekly seasonality is plotted

  • comp_name (str) – Name of seasonality component

  • weekly_start (int) –

    Specifying the start day of the weekly seasonality plot

    Options
    • (default) weekly_start = 0: starts the week on Sunday

    • weekly_start = 1: shifts by 1 day to Monday, and so on

  • quick (bool) – Use quick low-level call of model

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

  • figsize (tuple) –

    Width, height in inches, ignored if ax is not None.

    Note

    Default value is set to figsize = (10, 6)

  • df_name (str) –

    Name of dataframe to refer to data params from original keys of train dataframes

    Note

    Only used for local normalization in global modeling

Returns

List of Artist objects containing weekly forecast component

Return type

matplotlib.artist.Artist

neuralprophet.plot_model_parameters_matplotlib.plot_yearly(m, quantile, comp_name='yearly', yearly_start=0, quick=True, ax=None, figsize=(10, 6), df_name='__df__')#

Plot the yearly component of the forecast.

Parameters
  • m (NeuralProphet) – Fitted model

  • quantile (float) – The quantile for which the yearly seasonality is plotted

  • comp_name (str) – Name of seasonality component

  • yearly_start (int) –

    Specifying the start day of the yearly seasonality plot

    Options
    • (default) yearly_start = 0: starts the year on Jan 1

    • yearly_start = 1: shifts by 1 day to Jan 2, and so on

  • quick (bool) – Use quick low-level call of model

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

  • figsize (tuple) –

    Width, height in inches, ignored if ax is not None.

    Note

    Default value is set to figsize = (10, 6)

  • df_name (str) –

    Name of dataframe to refer to data params from original keys of train dataframes

    Note

    Only used for local normalization in global modeling

Returns

List of Artist objects containing yearly forecast component

Return type

matplotlib.artist.Artist