pyhealth.tasks.ChestXray14BinaryClassification#
- class pyhealth.tasks.ChestXray14BinaryClassification(disease)[source]#
Bases:
BaseTaskA PyHealth task class for binary classification of a specific disease in the ChestXray14 dataset.
Examples
>>> from pyhealth.datasets import ChestXray14Dataset >>> from pyhealth.tasks import ChestXray14BinaryClassification >>> dataset = ChestXray14Dataset(root="/path/to/chestxray14") >>> task = ChestXray14BinaryClassification(disease="pneumonia") >>> samples = dataset.set_task(task)
Initializes the ChestXray14BinaryClassification task with a specified disease.
- Parameters:
disease (str) – The disease to classify in the binary task. Must be one of the predefined class labels in ChestXray14Dataset.
- Raises:
ValueError – If the specified disease is not a valid class in the dataset.
- __init__(disease)[source]#
Initializes the ChestXray14BinaryClassification task with a specified disease.
- Parameters:
disease (str) – The disease to classify in the binary task. Must be one of the predefined class labels in ChestXray14Dataset.
- Raises:
ValueError – If the specified disease is not a valid class in the dataset.
- pre_filter(df)#
- Return type:
LazyFrame