scvi.dataloaders.MappedCollectionDataModule#

class scvi.dataloaders.MappedCollectionDataModule(collection, batch_key=None, label_key=None, unlabeled_category='Unknown', sample_key=None, batch_size=128, collection_val=None, accelerator='auto', device='auto', shuffle=True, model_name='SCVI', categorical_covariate_keys=None, continuous_covariate_keys=None, **kwargs)[source]#

Bases: LightningDataModule

Attributes table#

Methods table#

close()

inference_dataloader([shuffle, batch_size, ...])

Dataloader for inference with on_before_batch_transfer applied.

on_before_batch_transfer(batch, dataloader_idx)

Convert a lamindb MappedCollection batch to the dictionary scvi-tools expects.

train_dataloader()

Create the train data loader.

val_dataloader()

Create the validation data loader.

Attributes#

MappedCollectionDataModule.batch_labels#
MappedCollectionDataModule.extra_categorical_covs#
MappedCollectionDataModule.extra_continuous_covs#
MappedCollectionDataModule.label_keys#
MappedCollectionDataModule.labels#
MappedCollectionDataModule.n_batch#
MappedCollectionDataModule.n_labels#
MappedCollectionDataModule.n_obs#
MappedCollectionDataModule.n_samples#
MappedCollectionDataModule.n_vars#
MappedCollectionDataModule.registry#
MappedCollectionDataModule.sample_keys#
MappedCollectionDataModule.samples#
MappedCollectionDataModule.unlabeled_category#

String assigned to unlabeled cells.

MappedCollectionDataModule.var_names#

Methods#

MappedCollectionDataModule.close()[source]#
MappedCollectionDataModule.inference_dataloader(shuffle=False, batch_size=4096, indices=None, parallel_cpu_count=None)[source]#

Dataloader for inference with on_before_batch_transfer applied.

MappedCollectionDataModule.on_before_batch_transfer(batch, dataloader_idx)[source]#

Convert a lamindb MappedCollection batch to the dictionary scvi-tools expects.

MappedCollectionDataModule.train_dataloader()[source]#

Create the train data loader.

Return type:

DataLoader

MappedCollectionDataModule.val_dataloader()[source]#

Create the validation data loader.

Return type:

DataLoader