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[source]#
MappedCollectionDataModule.extra_categorical_covs[source]#
MappedCollectionDataModule.extra_continuous_covs[source]#
MappedCollectionDataModule.label_keys[source]#
MappedCollectionDataModule.labels[source]#
MappedCollectionDataModule.n_batch[source]#
MappedCollectionDataModule.n_labels[source]#
MappedCollectionDataModule.n_obs[source]#
MappedCollectionDataModule.n_samples[source]#
MappedCollectionDataModule.n_vars[source]#
MappedCollectionDataModule.registry[source]#
MappedCollectionDataModule.sample_keys[source]#
MappedCollectionDataModule.samples[source]#
MappedCollectionDataModule.unlabeled_category[source]#

String assigned to unlabeled cells.

MappedCollectionDataModule.var_names[source]#

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