leaspy.models.model_factory.ModelFactory

class ModelFactory

Bases: object

Return the wanted model given its name.

Methods

model(name, **kwargs)

Return the model object corresponding to 'name' arg with possible kwargs

static model(name: str, **kwargs) AbstractModel

Return the model object corresponding to ‘name’ arg with possible kwargs

Check name type and value.

Parameters
namestr

The model’s name.

**kwargs

Contains model’s hyper-parameters. Raise an error if the keyword is inappropriate for the given model’s name.

Returns
AbstractModel

A child class object of models.AbstractModel class object determined by ‘name’.

Raises
LeaspyModelInputError

if incorrect model requested.

See also

Leaspy