leaspy.models.factory ===================== .. py:module:: leaspy.models.factory Classes ------- .. autoapisummary:: leaspy.models.factory.ModelName Functions --------- .. autoapisummary:: leaspy.models.factory.model_factory Module Contents --------------- .. py:class:: ModelName Bases: :py:obj:`str`, :py:obj:`enum.Enum` The available models that users can instantiate in Leaspy. .. !! processed by numpydoc !! .. py:attribute:: JOINT :value: 'joint' .. py:attribute:: LOGISTIC :value: 'logistic' .. py:attribute:: LINEAR :value: 'linear' .. py:attribute:: SHARED_SPEED_LOGISTIC :value: 'shared_speed_logistic' .. py:attribute:: LME :value: 'lme' .. py:attribute:: CONSTANT :value: 'constant' .. py:attribute:: MIXTURE_LOGISTIC :value: 'mixture_logistic' .. py:function:: model_factory(name, instance_name = None, **kwargs) Return the model object corresponding to ``name`` arg with possible ``kwargs``. :Parameters: **name** : :obj:`str` or ModelName The name of the model class to be instantiated. Valid options include: - ``"joint"`` - ``"logistic"`` - ``"linear"`` - ``"shared_speed_logistic"`` - ``"lme"`` - ``"constant"`` - ``"mixture_logistic"`` **instance_name** : :obj:`str`, optional A custom name for the model instance. If not provided, the model's name will be used as the instance name. **\*\*kwargs** Additional keyword arguments corresponding to the model's hyperparameters. These must be valid for the specified model, or an error will be raised. :Returns: :class:`.BaseModel` A child class object of :class:`.models.BaseModel` class object determined by ``name``. :Raises: ValueError If an invalid model name is provided or the model cannot be instantiated with the provided arguments. .. !! processed by numpydoc !!