leaspy.models.factory

Classes

ModelName

The available models that users can instantiate in Leaspy.

Functions

model_factory(name[, instance_name])

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

Module Contents

class ModelName

Bases: str, enum.Enum

The available models that users can instantiate in Leaspy.

JOINT = 'joint'
LOGISTIC = 'logistic'
LINEAR = 'linear'
SHARED_SPEED_LOGISTIC = 'shared_speed_logistic'
LME = 'lme'
CONSTANT = 'constant'
model_factory(name, instance_name=None, **kwargs)

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

Parameters:
namestr or ModelName

The name of the model class to be instantiated.

instance_namestr, optional

The custom name of the instance to be created. If not provided, it will be the model class 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.

Parameters:
Return type:

BaseModel