pyhealth.tasks.CancerSurvivalPrediction#

class pyhealth.tasks.CancerSurvivalPrediction(code_mapping=None)[source]#

Bases: BaseTask

Task 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.

task_name#

The name of the task.

Type:

str

input_schema#

The input schema specifying required inputs.

Type:

Dict[str, str]

output_schema#

The output schema specifying outputs.

Type:

Dict[str, str]

VITAL_STATUS_DEAD#

Values indicating deceased status.

Type:

tuple

VITAL_STATUS_ALIVE#

Values indicating alive status.

Type:

tuple

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)
task_name: str = 'CancerSurvivalPrediction'#
input_schema: Dict[str, str] = {'age_at_diagnosis': 'tensor', 'gleason_score': 'tensor', 'mutations': 'sequence'}#
output_schema: Dict[str, str] = {'vital_status': 'binary'}#
VITAL_STATUS_DEAD: tuple = ('dead', 'deceased', '1')#
VITAL_STATUS_ALIVE: tuple = ('alive', 'living', '0')#
pre_filter(df)#
Return type:

LazyFrame