Core Module Documentation#

class neuralprophet.components.seasonality.base.Seasonality(config, id_list, quantiles, num_seasonalities_modelled, num_seasonalities_modelled_dict, n_forecasts, device)#
class neuralprophet.components.seasonality.fourier.FourierSeasonality(config, id_list, quantiles, num_seasonalities_modelled, num_seasonalities_modelled_dict, n_forecasts, device)#
abstract compute_fourier(features, name, meta=None)#

Compute single seasonality component.

Parameters
  • features (torch.Tensor, float) – Features related to seasonality component, dims: (batch, n_forecasts, n_features)

  • name (str) – Name of seasonality. for attribution to corresponding model weights.

  • meta (dict) –

    Metadata about the all the samples of the model input batch. Contains the following:
    • df_name (list, str), time series ID corresponding to each sample of the input batch.

Returns

Forecast component of dims (batch, n_forecasts)

Return type

torch.Tensor

forward(s, meta)#

Compute all seasonality components.

Parameters
  • s (torch.Tensor, float) – dict of named seasonalities (keys) with their features (values) dims of each dict value (batch, n_forecasts, n_features)

  • meta (dict) –

    Metadata about the all the samples of the model input batch. Contains the following:
    • df_name (list, str), time series ID corresponding to each sample of the input batch.

Returns

Forecast component of dims (batch, n_forecasts)

Return type

torch.Tensor

class neuralprophet.components.seasonality.fourier.GlobalFourierSeasonality(config, id_list, quantiles, num_seasonalities_modelled, num_seasonalities_modelled_dict, n_forecasts, device)#
compute_fourier(features, name, meta=None)#

Compute single seasonality component.

Parameters
  • features (torch.Tensor, float) – Features related to seasonality component, dims: (batch, n_forecasts, n_features)

  • name (str) – Name of seasonality. for attribution to corresponding model weights.

  • meta (dict) –

    Metadata about the all the samples of the model input batch. Contains the following:
    • df_name (list, str), time series ID corresponding to each sample of the input batch.

Returns

Forecast component of dims (batch, n_forecasts)

Return type

torch.Tensor

class neuralprophet.components.seasonality.fourier.GlocalFourierSeasonality(config, id_list, quantiles, num_seasonalities_modelled, num_seasonalities_modelled_dict, n_forecasts, device)#
compute_fourier(features, name, meta=None)#

Compute single seasonality component.

Parameters
  • features (torch.Tensor, float) – Features related to seasonality component, dims: (batch, n_forecasts, n_features)

  • name (str) – Name of seasonality. for attribution to corresponding model weights.

  • meta (dict) –

    Metadata about the all the samples of the model input batch. Contains the following:
    • df_name (list, str), time series ID corresponding to each sample of the input batch.

Returns

Forecast component of dims (batch, n_forecasts)

Return type

torch.Tensor

class neuralprophet.components.seasonality.fourier.LocalFourierSeasonality(config, id_list, quantiles, num_seasonalities_modelled, num_seasonalities_modelled_dict, n_forecasts, device)#
compute_fourier(features, name, meta=None)#

Compute single seasonality component.

Parameters
  • features (torch.Tensor, float) – Features related to seasonality component, dims: (batch, n_forecasts, n_features)

  • name (str) – Name of seasonality. for attribution to corresponding model weights.

  • meta (dict) –

    Metadata about the all the samples of the model input batch. Contains the following:
    • df_name (list, str), time series ID corresponding to each sample of the input batch.

Returns

Forecast component of dims (batch, n_forecasts)

Return type

torch.Tensor