leaspy.models.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) BaseModel

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:
BaseModel

A child class object of models.BaseModel class object determined by name.

Raises:
LeaspyModelInputError

If an incorrect model is requested.

See also

Leaspy