# Batch correction using scvI on multiple datasets + hyperparameter tuning of an scvI model

**URL:** <https://discourse.scverse.org/t/batch-correction-using-scvi-on-multiple-datasets-hyperparameter-tuning-of-an-scvi-model/2076>\
**Category:** scvi-tools\
**Tags:** integration, scvi, developer\
**Created:** [February 11, 2024, 6:54pm UTC](https://discourse.scverse.org/t/batch-correction-using-scvi-on-multiple-datasets-hyperparameter-tuning-of-an-scvi-model/2076 "2024-02-11T18:54:14Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![g12bftd](https://avatars.discourse-cdn.com/v4/letter/g/bcef8e/32.png) [@g12bftd](https://discourse.scverse.org/u/g12bftd)\
**Post date:** [February 11, 2024, 6:54pm UTC](https://discourse.scverse.org/t/batch-correction-using-scvi-on-multiple-datasets-hyperparameter-tuning-of-an-scvi-model/2076/1 "2024-02-11T18:54:14Z")

</div>

I want to perform batch integration on multiple datasets (loaded as separate h5ad files). Is there an exemplar code snippet on how to do this?

Once I’ve loaded and pre-processed the data, what is the best way to rigorously perform hyperparameter tuning of the scVI model?

---

<div class="post-metadata">

**Author:** ![martinkim0](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.scverse.org/martinkim0/32/881_2.png) [@martinkim0](https://discourse.scverse.org/u/martinkim0)\
**Post date:** [February 16, 2024, 5:45pm UTC](https://discourse.scverse.org/t/batch-correction-using-scvi-on-multiple-datasets-hyperparameter-tuning-of-an-scvi-model/2076/2 "2024-02-16T17:45:21Z")

</div>

For concatenating and integrating multiple datasets, please refer to [this tutorial](https://docs.scvi-tools.org/en/stable/tutorials/notebooks/scrna/tabula_muris.html) that combines two datasets.

For an example on how to perform hyperparameter tuning with scVI, please refer to [this tutorial](https://docs.scvi-tools.org/en/stable/tutorials/notebooks/tuning/autotune_scvi.html)
