pyhealth.tasks.ChestXray14BinaryClassification#

class pyhealth.tasks.ChestXray14BinaryClassification(disease)[source]#

Bases: BaseTask

A PyHealth task class for binary classification of a specific disease in the ChestXray14 dataset.

task_name#

The name of the task.

Type:

str

input_schema#

The schema for the task input.

Type:

Dict[str, str]

output_schema#

The schema for the task output.

Type:

Dict[str, str]

disease#

The disease label to classify.

Type:

str

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)
task_name: str = 'ChestXray14BinaryClassification'#
input_schema: Dict[str, str] = {'image': 'image'}#
output_schema: Dict[str, str] = {'label': 'binary'}#
pre_filter(df)#
Return type:

LazyFrame