mednet.data.classify.typing

Define specialized data typing for classification tasks.

Classes

ClassificationRawDataLoader()

A loader object can load samples and labels from storage for classification tasks.

class mednet.data.classify.typing.ClassificationRawDataLoader[source]

Bases: RawDataLoader

A loader object can load samples and labels from storage for classification tasks.

sample(sample)[source]

Load whole samples from media.

Parameters:

sample (tuple[str, int, Any | None]) – Information about the sample to load. Implementation dependent.

Return type:

tuple[Tensor, Mapping[str, Any]]

target(k)[source]

Load only sample target from media.

If you do not override this implementation, then, by default, this method will call sample() to load the whole sample and extract the label.

Parameters:

k (Any) – The sample to load. This is implementation-dependent.

Returns:

The label corresponding to the specified sample.

Return type:

int | list[int]