# Namespace auton_survival.models

## Sub-modules

auton_survival.models.cmhe

## Cox Mixtures With Heterogenous Effects

Cox Mixture with Heterogenous Effects (CMHE) is a flexible approach to recover counterfactual phenotypes of individuals that demonstrate heterogneous effects to an intervention in terms of censored Time-to-Event outcomes. CMHE is not restricted by the strong Cox Proportional Hazards assumption or any parametric assumption on the time to event distributions. CMHE achieves this by describing each individual as belonging to two different latent groups, $\mathcal{Z}$ that mediate the base survival rate and $\phi$ the effect of the treatment. CMHE can also be employed to model individual level counterfactuals or for standard factual survival regression.

For full details on Cox Mixtures with Heterogenous Effects, please refer to our preprint:

Counterfactual Phenotyping with Censored Time-to-Events, arXiv preprint, C. Nagpal, M. Goswami, K. Dufendach, A. Dubrawski

## Example Usage

>>> from auton_survival import DeepCoxMixturesHeterogenousEffects
>>> from auton_survival import datasets
>>> # load the SYNTHETIC dataset.
>>> x, t, e, a = datasets.load_dataset('SYNTHETIC')
>>> # instantiate a Cox Mixtures with Heterogenous Effects model.
>>> model = DeepCoxMixturesHeterogenousEffects()
>>> # fit the model to the dataset.
>>> model.fit(x, t, e, a)
>>> # estimate the predicted risks at the time
>>> model.predict_risk(x, 10)
>>> # estimate the treatment effect phenogroups
>>> model.predict_latent_phi(x)

auton_survival.models.cph

Deep Cox Proportional Hazards Model

auton_survival.models.dcm

## Deep Cox Mixtures

The Cox Mixture involves the assumption that the survival function of the individual to be a mixture of K Cox Models. Conditioned on each subgroup $Z=k$; the PH assumptions are assumed to hold and the baseline hazard rates is determined non-parametrically using an spline-interpolated Breslow's estimator.

For full details on Deep Cox Mixture, refer to the paper [1].

## References

  @article{nagpal2021dcm,
title={Deep Cox mixtures for survival regression},
author={Nagpal, Chirag and Yadlowsky, Steve and Rostamzadeh, Negar and Heller, Katherine},
journal={arXiv preprint arXiv:2101.06536},
year={2021}
}

auton_survival.models.dsm

## Deep Survival Machines

Deep Survival Machines (DSM) is a fully parametric approach to model Time-to-Event outcomes in the presence of Censoring first introduced in [1]. In the context of Healthcare ML and Biostatistics, this is known as 'Survival Analysis'. The key idea behind Deep Survival Machines is to model the underlying event outcome distribution as a mixure of some fixed $k$ parametric distributions. The parameters of these mixture distributions as well as the mixing weights are modelled using Neural Networks.

## Example Usage

>>> from dsm import DeepSurvivalMachines
>>> from dsm import datasets
>>> # load the SUPPORT dataset.
>>> x, t, e = datasets.load_dataset('SUPPORT')
>>> # instantiate a DeepSurvivalMachines model.
>>> model = DeepSurvivalMachines()
>>> # fit the model to the dataset.
>>> model.fit(x, t, e)
>>> # estimate the predicted risks at the time
>>> model.predict_risk(x, 10)


## Deep Recurrent Survival Machines

Deep Recurrent Survival Machines (DRSM) builds on the original DSM model and allows for learning of representations of the input covariates using Recurrent Neural Networks like LSTMs, GRUs. Deep Recurrent Survival Machines is a natural fit to model problems where there are time dependendent covariates. Examples include situations where we are working with streaming data like vital signs, degradation monitoring signals in predictive maintainance. DRSM allows the learnt representations at each time step to involve historical context from previous time steps. DRSM implementation in auton_survival.models.dsm is carried out through an easy to use API, DeepRecurrentSurvivalMachines that accepts lists of data streams and corresponding failure times. The module automatically takes care of appropriate batching and padding of variable length sequences.

## Deep Convolutional Survival Machines

Predictive maintenance and medical imaging sometimes requires to work with image streams. Deep Convolutional Survival Machines extends DSM and DRSM to learn representations of the input image data using convolutional layers. If working with streaming data, the learnt representations are then passed through an LSTM to model temporal dependencies before determining the underlying survival distributions.

Warning: Not Implemented Yet!

## References

Please cite the following papers if you are using the auton_survival package.

  @article{nagpal2021dsm,
title={Deep survival machines: Fully parametric survival regression and representation learning for censored data with competing risks},
author={Nagpal, Chirag and Li, Xinyu and Dubrawski, Artur},
journal={IEEE Journal of Biomedical and Health Informatics},
volume={25},
number={8},
pages={3163--3175},
year={2021},
publisher={IEEE}
}

  @InProceedings{pmlr-v146-nagpal21a,
title={Deep Parametric Time-to-Event Regression with Time-Varying Covariates},
author={Nagpal, Chirag and Jeanselme, Vincent and Dubrawski, Artur},
booktitle={Proceedings of AAAI Spring Symposium on Survival Prediction - Algorithms, Challenges, and Applications 2021},
series={Proceedings of Machine Learning Research},
publisher={PMLR},
}

  @inproceedings{nagpal2021dcm,
title={Deep Cox mixtures for survival regression},
author={Nagpal, Chirag and Yadlowsky, Steve and Rostamzadeh, Negar and Heller, Katherine},
booktitle={Machine Learning for Healthcare Conference},
pages={674--708},
year={2021},
organization={PMLR}
}

  @article{nagpal2022counterfactual,
title={Counterfactual Phenotyping with Censored Time-to-Events},
author={Nagpal, Chirag and Goswami, Mononito and Dufendach, Keith and Dubrawski, Artur},
journal={arXiv preprint arXiv:2202.11089},
year={2022}
}