class darts.utils.likelihood_models.base.Likelihood(likelihood_type, parameter_names)[source]

Bases: object

Base class for all likelihoods.

  • likelihoods for torch models

  • likelihoods for sklearn-like models (e.g. RegressionModel subclasses)

Parameters
  • likelihood_type (LikelihoodType) – A pre-defined LikelihoodType.

  • parameter_names (list[str]) – The likelihood (distribution) parameter names.

Attributes

num_parameters

Returns the number of distribution parameters for a single target value.

parameter_names

Returns the likelihood parameter names.

type

Returns the likelihood type.

Methods

component_names(input_series)

Generates names for the parameters of the Likelihood.

component_names(input_series)[source]

Generates names for the parameters of the Likelihood.

Return type

list[str]

property num_parameters: int

Returns the number of distribution parameters for a single target value.

Return type

int

property parameter_names: list[str]

Returns the likelihood parameter names.

Return type

list[str]

property type: LikelihoodType

Returns the likelihood type.

Return type

LikelihoodType

class darts.utils.likelihood_models.base.LikelihoodType(value)[source]

Bases: Enum

An enumeration.

Bernoulli = 'bernoulli'
Beta = 'beta'
Cauchy = 'cauchy'
ContinuousBernoulli = 'continuousbernoulli'
Dirichlet = 'dirichlet'
Exponential = 'exponential'
Gamma = 'gamma'
Gaussian = 'gaussian'
Geometric = 'geometric'
Gumbel = 'gumbel'
HalfNormal = 'halfnormal'
Laplace = 'laplace'
LogNormal = 'lognormal'
NegativeBinomial = 'negativebinomial'
Poisson = 'poisson'
Quantile = 'quantile'
Weibull = 'weibull'
darts.utils.likelihood_models.base.likelihood_component_names(components, parameter_names)[source]

Generates formatted likelihood parameter names for components and parameter names.

The order of the returned names is: [comp1_param_1, … comp1_param_n, …, comp_n_param_n].

Parameters
  • components (Union[Index, list[str]]) – A sequence of component names to add to the beginning of the returned names.

  • parameter_names (list[str]) – A sequence of likelihood parameter names to add to the end of the returned names.

darts.utils.likelihood_models.base.quantile_interval_names(q_interval, component=None)[source]

Generates formatted quantile interval names, optionally added to a component name.

Parameters
  • q_interval (Union[tuple[float, float], Sequence[tuple[float, float]]]) – A tuple or multiple tuples with the (lower bound, upper bound) of the quantile intervals.

  • component (Optional[str, None]) – Optionally, a component name to add to the beginning of the quantile names.

darts.utils.likelihood_models.base.quantile_names(q, component=None)[source]

Generates formatted quantile names, optionally added to a component name.

Parameters
  • q (Union[float, list[float]]) – A float or list of floats with the quantiles to generate the names for.

  • component (Optional[str, None]) – Optionally, a component name to add to the beginning of the quantile names.