New in 0.8.6 (2024-03-25)#
We provide an example script to use the built-in hyperparameter optimization function in CPA (based on scvi-tools hyperparam optimizer). You can find the script at examples/tune_script.py.
After the hyperparameter optimization using tune_script.py is done, result_grid.pkl is saved in your current directory using the pickle library. You can load the results using the following code:
```python import pickle with open(‘result_grid.pkl’, ‘rb’) as f:
result_grid = pickle.load(f)
``` From here, you can follow the instructions in the [Ray Documentations](https://docs.ray.io/en/latest/tune/examples/tune_analyze_results.html#experiment-level-analysis-working-with-resultgrid) to analyze the run, and choose the best hyperparameters for your data.
You can also use the integration with wandb to log the hyperparameter optimization results. You can find the script at examples/tune_script_wandb.py. –> use_wandb=True
Everything is based on [Ray Tune](https://ray.io/). You can find more information about the hyperparameter optimization in the [Ray Tune Documentations](https://docs.ray.io/en/latest/tune/index.html).
The tuner is adapted and adjusted from scvi-tools v1.2.0 (unreleased) [release notes](https://docs.scvi-tools.org/en/stable/release_notes/index.html)