Core Module Documentation#

neuralprophet.plot_model_parameters_plotly.get_dynamic_axis_range(df_range, type, pad=0.05, inverse=False)#

Adds a percentage of values at both ends of a list for plotting.

Parameters
  • df_range (np.array) – Array of axis values to pad

  • type (str) – Type of values in the list to pad

  • pad (float) – Percentage of padding to add to each end of the range

  • inverse (bool) – Flag for list sorted in an inverted order

Return type

Padded range of values

neuralprophet.plot_model_parameters_plotly.plot_custom_season(m, comp_name, quantile, multiplicative=False, 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

  • multiplicative (bool) – Flag whether to set y axis as percentage

  • 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

Return type

Dictionary with plotly traces, xaxis and yaxis

neuralprophet.plot_model_parameters_plotly.plot_daily(m, quantile, comp_name='daily', quick=True, multiplicative=False, df_name='__df__')#

Plot the daily 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 if previously changed from default daily

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

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

  • multiplicative (bool) – Flag whether to set y axis as percentage

  • 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

Return type

Dictionary with plotly traces, xaxis and yaxis

neuralprophet.plot_model_parameters_plotly.plot_lagged_weights(weights, comp_name, focus=None)#

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

Return type

Dictionary with plotly traces, xaxis and yaxis

neuralprophet.plot_model_parameters_plotly.plot_parameters(m, plot_configuration, quantile=0.5, weekly_start=0, yearly_start=0, figsize=(700, 210), df_name=None, forecast_in_focus=None, resampler_active=False, plotly_static=False)#

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 = (700, 210 * 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

  • resampler_active (bool) – Flag whether to activate the plotly-resampler

  • plotly_static (bool) – Flag whether to generate a static svg image

Returns

Plotly figure

neuralprophet.plot_model_parameters_plotly.plot_scalar_weights(weights, plot_name, focus=None, multiplicative=False)#

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

  • multiplicative (bool) – Flag to set y axis as percentage

Return type

Dictionary with Plotly traces, xaxis and yaxis

neuralprophet.plot_model_parameters_plotly.plot_trend(m, quantile, plot_name='Trend Change', df_name='__df__')#

Make a barplot of the magnitudes of trend-changes.

Parameters
  • m (NeuralProphet) – Fitted model

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

  • plot_name (str) – Name of the plot Title

  • 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

Return type

Dictionary with plotly traces, xaxis and yaxis

neuralprophet.plot_model_parameters_plotly.plot_trend_change(m, quantile, plot_name='Trend Change', df_name='__df__')#

Make a barplot of the magnitudes of trend-changes.

Parameters
  • m (NeuralProphet) – Fitted model

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

  • plot_name (str) – Name of the plot Title

  • 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

Return type

Dictionary with plotly traces, xaxis and yaxis

neuralprophet.plot_model_parameters_plotly.plot_weekly(m, quantile, comp_name='weekly', weekly_start=0, quick=True, multiplicative=False, df_name='__df__')#

Plot the weekly 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

  • 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

  • multplicative (bool) – Flag to set y axis as percentage

  • 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

Return type

Dictionary with plotly traces, xaxis and yaxis

neuralprophet.plot_model_parameters_plotly.plot_yearly(m, quantile, comp_name='yearly', yearly_start=0, quick=True, multiplicative=False, 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

  • multiplicative (bool) – Flag to set y axis as percentage

  • 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