leaspy.models.joint =================== .. py:module:: leaspy.models.joint Classes ------- .. autoapisummary:: leaspy.models.joint.JointModel Module Contents --------------- .. py:class:: JointModel(name, **kwargs) Bases: :py:obj:`leaspy.models.logistic.LogisticModel` Joint model for multiple repeated measures (logistic) and multiple competing events. The model implemented is associated to this [publication](https://arxiv.org/abs/2501.08960) on arxiv. :Parameters: **name** : :obj:`str` The name of the model. **\*\*kwargs** Hyperparameters of the model (including `noise_model`) :Raises: :exc:`.LeaspyModelInputError` * If `name` is not one of allowed sub-type: 'univariate_linear' or 'univariate_logistic' * If hyperparameters are inconsistent .. !! processed by numpydoc !! .. py:attribute:: init_tolerance :type: float :value: 0.3 .. py:method:: get_variables_specs() Return the specifications of the variables (latent variables, derived variables, model 'parameters') that are part of the model. :Returns: NamedVariables The specifications of the model's variables. .. !! processed by numpydoc !! .. py:method:: to_dict(*, with_mixing_matrix = True) Export model as a dictionary ready for export. Add the number of events compare to the multivariate output :Parameters: **with_mixing_matrix** : :obj:`bool` If True the mixing matrix will be saved in the dictionary :Returns: KwargsType The model instance serialized as a dictionary. .. !! processed by numpydoc !! .. py:method:: put_individual_parameters(state, dataset) Initialise the individual parameters of the state thanks to the dataset. :Parameters: **state** : :class:`State` where all the variables of the model are stored **dataset** : :class:`Dataset` Where the individual data are stored :Returns: None .. .. !! processed by numpydoc !! .. py:method:: compute_individual_trajectory(timepoints, individual_parameters, *, skip_ips_checks = False) This method computes the individual trajectory of a patient for given timepoint(s) using his/her individual parameters (random effects). For the longitudinal sub-model: - Compute longitudinal values For the event sub-model: - only one event: return the survival rate corrected by the probability of the first time point of the prediction assuming that the patient was alive, - more than one event: return the Cumulative Incidence function corrected by the probability of the first time point of the prediction assuming that the patient was alive. Nota: model uses its current internal state. :Parameters: **timepoints** : scalar or array_like[scalar] (:obj:`list`, :obj:`tuple`, :class:`numpy.ndarray`) Contains the age(s) of the subject. **individual_parameters** : :obj:`dict` Contains the individual parameters. Each individual parameter should be a scalar or array_like. **skip_ips_checks** : :obj:`bool` (default: ``False``) Flag to skip consistency/compatibility checks and tensorization of ``individual_parameters`` when it was done earlier (speed-up). :Returns: :class:`torch.Tensor` Contains the subject's scores computed at the given age(s) Shape of tensor is ``(1, n_tpts, n_features)``. :Raises: :exc:`.LeaspyModelInputError` If computation is tried on more than 1 individual. :exc:`.LeaspyIndividualParamsInputError` if invalid individual parameters. .. !! processed by numpydoc !!