Core Module Documentation#

class neuralprophet.components.future_regressors.base.FutureRegressors(config, id_list, quantiles, n_forecasts, device, config_trend_none_bool)#
class neuralprophet.components.future_regressors.linear.LinearFutureRegressors(config, id_list, quantiles, n_forecasts, device, config_trend_none_bool)#
forward(inputs, mode, indeces=None)#

Compute all seasonality components. :param f_r: future regressors inputs :type f_r: torch.Tensor, float :param mode: mode of the regressors :type mode: string, either “additive” or “multiplicative”

Returns

Forecast component of dims (batch, n_forecasts, no_quantiles)

Return type

torch.Tensor

get_reg_weights(name)#

Retrieve the weights of regressor features given the name

Parameters

name (string) – Regressor name

Returns

Weight corresponding to the given regressor

Return type

torch.tensor

scalar_features_effects(features, params, indices=None)#

Computes events component of the model

Parameters
  • features (torch.Tensor, float) – Features (either additive or multiplicative) related to event component dims (batch, n_forecasts, n_features)

  • params (nn.Parameter) – Params (either additive or multiplicative) related to events

  • indices (list of int) – Indices in the feature tensors related to a particular event

Returns

Forecast component of dims (batch, n_forecasts)

Return type

torch.Tensor

class neuralprophet.components.future_regressors.neural_nets.NeuralNetsFutureRegressors(config, id_list, quantiles, n_forecasts, device, config_trend_none_bool)#
all_regressors(regressor_inputs, mode)#

Compute all regressors components. :param regressor_inputs: regressor values at corresponding, dims: (batch, n_forecasts, num_regressors) :type regressor_inputs: torch.Tensor, float

Returns

Forecast component of dims (batch, n_forecasts, num_quantiles)

Return type

torch.Tensor

forward(inputs, mode, indeces=None)#

Compute all seasonality components. :param f_r: future regressors inputs :type f_r: torch.Tensor, float :param mode: mode of the regressors :type mode: string, either “additive” or “multiplicative”

Returns

Forecast component of dims (batch, n_forecasts, no_quantiles)

Return type

torch.Tensor

get_reg_weights(name)#

Get attributions of regressors component network w.r.t. the model input.

Parameters

name (string) – Regressor name

Returns

Weight corresponding to the given regressor

Return type

torch.tensor

regressor(regressor_input, name)#

Compute single regressor component. :param regressor_input: regressor values at corresponding, dims: (batch, n_forecasts, 1) :type regressor_input: torch.Tensor, float :param nam: Name of regressor, for attribution to corresponding model weights :type nam: str

Returns

Forecast component of dims (batch, n_forecasts, num_quantiles)

Return type

torch.Tensor

class neuralprophet.components.future_regressors.shared_neural_nets_coef.SharedNeuralNetsCoefFutureRegressors(config, id_list, quantiles, n_forecasts, device, config_trend_none_bool)#
forward(inputs, mode, indeces=None)#

Compute all seasonality components. :param inputs: future regressors inputs :type inputs: torch.Tensor, float :param mode: mode of the regressors :type mode: string, either “additive” or “multiplicative”

Returns

Forecast component of dims (batch, n_forecasts, no_quantiles)

Return type

torch.Tensor

get_reg_weights(name)#

Get attributions of regressors component network w.r.t. the model input.

Parameters

name (string) – Regressor name

Returns

Weight corresponding to the given regressor

Return type

torch.tensor

regressors_net(regressor_inputs, mode)#

Compute single regressor component. :param regressor_input: regressor values at corresponding, dims: (batch, n_forecasts, num_regressors) :type regressor_input: torch.Tensor, float :param nam: Name of regressor, for attribution to corresponding model weights :type nam: str

Returns

Forecast component of dims (batch, n_forecasts, num_quantiles)

Return type

torch.Tensor

class neuralprophet.components.future_regressors.shared_neural_nets.SharedNeuralNetsFutureRegressors(config, id_list, quantiles, n_forecasts, device, config_trend_none_bool)#
forward(inputs, mode, indeces=None)#

Compute all seasonality components. :param f_r: future regressors inputs :type f_r: torch.Tensor, float :param mode: mode of the regressors :type mode: string, either “additive” or “multiplicative”

Returns

Forecast component of dims (batch, n_forecasts, no_quantiles)

Return type

torch.Tensor

get_reg_weights(name)#

Get attributions of regressors component network w.r.t. the model input.

Parameters

name (string) – Regressor name

Returns

Weight corresponding to the given regressor

Return type

torch.tensor

regressors_net(regressor_inputs, mode)#

Compute single regressor component. :param regressor_input: regressor values at corresponding, dims: (batch, n_forecasts, 1) :type regressor_input: torch.Tensor, float :param nam: Name of regressor, for attribution to corresponding model weights :type nam: str

Returns

Forecast component of dims (batch, n_forecasts, num_quantiles)

Return type

torch.Tensor