pyhealth.tasks.ChestXray14MultilabelClassification#
- class pyhealth.tasks.ChestXray14MultilabelClassification(code_mapping=None)[source]#
Bases:
BaseTaskA PyHealth task class for multilabel classification of all fourteen diseases in the ChestXray14 dataset.
Examples
>>> from pyhealth.datasets import ChestXray14Dataset >>> from pyhealth.tasks import ChestXray14MultilabelClassification >>> dataset = ChestXray14Dataset(root="/path/to/chestxray14") >>> task = ChestXray14MultilabelClassification() >>> samples = dataset.set_task(task)
Initialize a task with optional code mapping.
- Parameters:
code_mapping (
Optional[Dict[str,Tuple[str,str]]]) –optional dict mapping feature keys to
(source_vocab, target_vocab)tuples. For example:code_mapping={ "conditions": ("ICD9CM", "CCSCM"), "procedures": ("ICD9PROC", "CCSPROC"), "drugs": ("NDC", "ATC"), }
When provided, the corresponding
input_schemaentries are upgraded from"sequence"to("sequence", {"code_mapping": (src, tgt)})so that theSequenceProcessormaps raw codes at fit/process time.
- __init__(code_mapping=None)#
Initialize a task with optional code mapping.
- Parameters:
code_mapping (
Optional[Dict[str,Tuple[str,str]]]) –optional dict mapping feature keys to
(source_vocab, target_vocab)tuples. For example:code_mapping={ "conditions": ("ICD9CM", "CCSCM"), "procedures": ("ICD9PROC", "CCSPROC"), "drugs": ("NDC", "ATC"), }
When provided, the corresponding
input_schemaentries are upgraded from"sequence"to("sequence", {"code_mapping": (src, tgt)})so that theSequenceProcessormaps raw codes at fit/process time.
- pre_filter(df)#
- Return type:
LazyFrame