pyhealth.tasks.CancerSurvivalPrediction#
- class pyhealth.tasks.CancerSurvivalPrediction(code_mapping=None)[source]#
Bases:
BaseTaskTask for predicting cancer patient survival outcomes.
This task predicts whether a cancer patient is alive or deceased based on their mutation profile and clinical features from TCGA datasets.
Note
Patients without clinical data or with unknown vital status are excluded from the output samples.
Examples
>>> from pyhealth.datasets import TCGAPRADDataset >>> from pyhealth.tasks import CancerSurvivalPrediction >>> dataset = TCGAPRADDataset(root="/path/to/tcga_prad") >>> task = CancerSurvivalPrediction() >>> samples = dataset.set_task(task)
- input_schema: Dict[str, str] = {'age_at_diagnosis': 'tensor', 'gleason_score': 'tensor', 'mutations': 'sequence'}#
- pre_filter(df)#
- Return type:
LazyFrame