cellmap_data.CellMapSubset#

class cellmap_data.CellMapSubset(dataset: CellMapDataset | CellMapMultiDataset, indices: Sequence[int])[source]#
Parameters:
  • dataset (Dataset[_T_co]) – CellMapDataset | CellMapMultiDataset The dataset to be subsetted.

  • indices (Sequence[int]) – Sequence[int] The indices of the dataset to be used as the subset.

__init__(dataset: CellMapDataset | CellMapMultiDataset, indices: Sequence[int]) None[source]#
Parameters:
  • dataset (CellMapDataset | CellMapMultiDataset) – CellMapDataset | CellMapMultiDataset The dataset to be subsetted.

  • indices (Sequence[int]) – Sequence[int] The indices of the dataset to be used as the subset.

Return type:

None

Methods

__init__(dataset, indices)

set_raw_value_transforms(transforms)

Sets the raw value transforms for the subset dataset.

set_target_value_transforms(transforms)

Sets the target value transforms for the subset dataset.

to(device)

Move the dataset to the specified device.

Attributes

class_counts

The number of samples in each class in the dataset normalized by resolution.

class_weights

The class weights for the dataset based on the number of samples in each class.

classes

The classes in the dataset.

validation_indices

The indices of the validation set.

dataset

indices

property classes: Sequence[str]#

The classes in the dataset.

property class_counts: dict[str, float]#

The number of samples in each class in the dataset normalized by resolution.

property class_weights: dict[str, float]#

The class weights for the dataset based on the number of samples in each class.

property validation_indices: Sequence[int]#

The indices of the validation set.

to(device) CellMapSubset[source]#

Move the dataset to the specified device.

Return type:

CellMapSubset

set_raw_value_transforms(transforms: Callable) None[source]#

Sets the raw value transforms for the subset dataset.

Parameters:

transforms (Callable)

Return type:

None

set_target_value_transforms(transforms: Callable) None[source]#

Sets the target value transforms for the subset dataset.

Parameters:

transforms (Callable)

Return type:

None