Saving a study locally
See original GitHub issueHi !
From what I read in the optuna.study.create_study
documentation, the storage
parameter only takes a database URL as input. Is there a way to persist a study locally? (I’m already using MLflow to log my metrics and model parameters, could it help?)
Thanks for your input 😃
Issue Analytics
- State:
- Created 2 years ago
- Comments:5
Top Results From Across the Web
3 Ways to Save Time Studying: Easy Time-Saving Tips
Trying to force yourself to study a ton of information during the last couple of days leading up to your exam is incredibly...
Read more >Studying locally | Goldsmiths, University of London
1. Saving money. Staying local could help to keep down costs as you are already familiar with your outgoings and won't need to...
Read more >Advantages Of Studying Locally Essay Sample 2023
The cost factor is considered when one decides to study locally. The cost of living is affordable and friendly because it saves one...
Read more >Studying locally and studying abroad: Pros & Cons
First, studying in local universities can save the cost compared to studying in universities abroad. The different countries have different currency rate.
Read more >"Studying locally is very beneficial to students" | University of ...
In my own experience, studying locally is very beneficial to students. You can get the support of friends and family (both morally and ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@nbkn865 Thanks for your input 😃. I wasn’t aware of the built-in SQLite database in Python that can run locally. I’m going to try to implement your solution 👍🏻
@dianemarquette, not familiar with Hydra, but it looks like a Python package, and it looks like there’s a parameter for Optuna storage. Given that, have you tried using the built-in SQLite database in Python?
From a Python call, you can set an Optuna study to store in SQLite that resides locally on whatever path your script is on.
For example:
study_name = “my_study” storage_name = f"sqlite:///{study_name}.db" study = optuna.create_study(study_name=study_name, storage=storage_name, load_if_exists=True)
This will create a file called my_study.db in the directory of your Python script that stores the study
You can then query its results using the following method call that creates a pandas dataframe:
df = study.trials_dataframe() # Get all columns of study
Based on the above, and using the Hydra documentation, maybe you can try the following parameter for
storage
andstudy_name
:sampler: target: optuna.samplers.TPESampler seed: 123 … warn_independent_sampling: true target: hydra_plugins.hydra_optuna_sweeper.optuna_sweeper.OptunaSweeper direction: minimize storage: sqlite:///my_test_study.db study_name: my_test_study