ä»åã¯ãããªã¼ã½ããã®DB4Sã®ã¤ã³ã¹ãã¼ã«æ¹æ³ã¨ã使ãæ¹ã説æãã¾ãã
対象ã¯ãSQLiteã§ãOptunaã®ã®ãã¼ã¿ãã¼ã¹ãã¡ã¤ã«ã使ã£ã¦ãå
·ä½çãªæä½æ¹æ³ããè¨è¼ãã¾ãã
ã¾ããGoogle Colaboratoryã§ãSQLå½ä»¤ãå®è¡ããæ¹æ³ã«ã¤ãã¦ãç´¹ä»ãã¾ãã
ãã®å
容ãåèã«ãªãã°å¹¸ãã§ãã
åèæç®
ã¯ããã«
Optunaã®è¨äºä¸è¦§ã§ããè¯ãã£ããåèã«ãã¦ãã ããã
Optunaã®è¨äºä¸è¦§
ã¾ããGUIã§ç°¡åã«SQLiteã®ãã¼ã¿ãã¼ã¹ãã¡ã¤ã«ã®å
容ã確èªã§ããDB Browser for SQLiteï¼DB4Sï¼ãã¤ã³ã¹ãã¼ã«ããæé ã説æãã¾ãã
DB4Sã¯ãSQLiteã®ãã¼ã¿ãã¼ã¹ ãã¡ã¤ã«ãä½æãè¨è¨ãç·¨éãããã¨ãã§ããGUIã®ãªã¼ãã³ã½ã¼ã¹ã®ãã¼ã«ã§ãã
Optunaã®ã¹ãã¬ã¼ã¸ã®å
容ã確èªã§ããã ãã§ãªãããã¼ã¿ãã¼ã¹ãã¡ã¤ã«ãç·¨éãããã¨ãã§ãããããã¹ã¿ãã£ã®å
容ãå°ãå¤æ´ãããå ´åãªã©ã«å¤§å¤éå®ãã¾ãã
å®éã«å½¹ç«ã£ãä¾ããããã¨ãOptuna Dashboardã§ã°ã©ããªã©ã表示ã§ãã¾ãããå¤ãå¤ã®ãããªå¦ç¿çµæãããã¨ãè¦ããã¹ã±ã¼ã«ã§è¦ããªãå ´åãããããã¾ãããã®å ´åã«ãDB4Sã§ãã¼ã¿ãã¼ã¹ãéããå¤ãå¤ã®ãããªå¦ç¿çµæããå®äºãã失æã«æ¸ãæããï¼COMPLETEâFAILï¼ã¨ãã°ã©ããè¦ããããã®ã«ãªãã¾ãã
ã§ã¯ããã£ã¦ããã¾ãããï¼
DB Browser for SQLiteï¼DB4Sï¼ã®ã¤ã³ã¹ãã¼ã«æ¹æ³
ã¾ãã¯ãDB4Sãã¤ã³ã¹ãã¼ã«ãã¦ããã¾ãã
ãã®ãªã³ã¯ã®ãDB Browser for SQLite - Standard installer for 64-bit Windowsãããã¦ã³ãã¼ãï¼32bitç°å¢ã®å ´åã¯ãã®ãã¡ã¤ã«ããã¦ã³ãã¼ãï¼ãã¾ãã
sqlitebrowser.org
以ä¸ã¯ãã¤ã³ã¹ãã¼ã«æé ã§ãã
注æç¹ã¯ãShortCutsã§ãå
¨ã¦ã«ãã§ãã¯ãå
¥ãããã¨ã§ãï¼
ããã«ãã§ãã¯ãå
¥ããªãã¨ãWindowsã®ã¡ãã¥ã¼ã«DB Browser for SQLiteã追å ãããªããããDB4Sãèµ·åããã®ãã¨ã¦ãé¢åã«ãªãã¾ãï¼
以ä¸ã§ãã¤ã³ã¹ãã¼ã«ã¯å®äºã§ãããç²ãæ§ã§ããã
DB Browser for SQLiteï¼DB4Sï¼ã®ä½¿ãæ¹
ã¤ã³ã¹ãã¼ã«ãå®äºããããå®éã«Optunaã®ã¹ãã¬ã¼ã¸ã®å
容ã確èªãã¦ã¿ã¾ãã
æé
- DB Browser (SQLite)ãèµ·åãã
- ããã¼ã¿ãã¼ã¹ãéãããã¯ãªãã¯
- ãã½ã³ã³çGoogleãã©ã¤ããã¤ã³ã¹ãã¼ã«ãã¦ãã°ãGoogleãã©ã¤ãããã¦ã³ããã¦ãããã©ã¤ããããoptuna.dbããæ¢ãã¦éãï¼ãã½ã³ã³çGoogleãã©ã¤ããã¤ã³ã¹ãã¼ã«ãã¦ããªãå ´åã¯ããã©ã¦ã¶ã§Googleãã©ã¤ããéããoptuna.dbããã¼ã«ã«ã«ãã¦ã³ãã¼ããã¦éãï¼
以ä¸ã®ãããªç»é¢ã«ãªãã¾ãã
ãã¼ã¿ãã¼ã¹æ§é ã®ã¿ãã表示ããã¦ãããoptuna.dbãæã¤13åã®ãã¼ãã«ã確èªã§ãã¾ãã
ç¶ãã¦ããã¼ã¿é²è¦§ã®ã¿ããã¯ãªãã¯ãã¦ã¿ã¾ããå
·ä½çãªãã¼ã¿ãè¦ããã¨æãã¾ãã
ãã¼ãã«ãä»ã®ãã¼ãã«ã«åãæ¿ããã¨ããã®ãã¼ãã«ã®å
容ã確èªã§ãã¾ãã
以ä¸ã¯ãstudiesãã¼ãã«ãé¸æããã¨ããã§ãã
ããã§ã¯ã3ã¤ã®ã¹ã¿ãã£ã確èªã§ãã¾ãã
ç¶ãã¦ãtrialsãã¼ãã«ãé¸æãã¾ãã
ä¸è¨ã®studiesãã¼ãã«ã®å
容ã確èªããã¨ããã§ããch2-rfãã¯ãstudy_idãã3ã§ãããtrialsãã¼ãã«ã«ã¯ãå
¨ã¦ã®ã¹ã¿ãã£ã®ãã©ã¤ã¢ã«ãæ ¼ç´ããã¦ããããstudy_idãã§ãã©ã®ã¹ã¿ãã£ã®ãã©ã¤ã¢ã«ããèå¥ã§ãã¾ãã
ãstateãã¨ããåãã1åã®ãã©ã¤ã¢ã«ï¼1åã®å¦ç¿ï¼ã®ç¶æ
ã示ãããCOMPLETEãã®å ´åã¯æ£å¸¸ã«ãã©ã¤ã¢ã«ï¼å¦ç¿ï¼ãçµäºããã¨ããæå³ã«ãªãã¾ãã
ãã©ã¤ã¢ã«ãç·¨éãããå ´åã¯ããã®ç»é¢ã§ãç·¨éããããã©ã¤ã¢ã«ã®è¡ã®ãç·¨éãããåï¼ä¾ãã°ãstateï¼ãé¸æããå³ä¸ã®ããã¹ãããã¯ã¹ã«è¡¨ç¤ºãããå¤ãå¤æ´ãããé©ç¨ããæ¼ãã¾ãï¼ãã®æç¹ã§ã¯ãã¼ã¿ãã¼ã¹ãã¡ã¤ã«ã«åæ ããã¦ãªãã®ã§æ³¨æï¼ï¼ã
å¤æ´å
容ã確èªãã¦ãåé¡ããªããã°ããå¤æ´ãæ¸ãè¾¼ã¿ããã¯ãªãã¯ããã¨ããã¼ã¿ãã¼ã¹ãã¡ã¤ã«ã«åæ ããã¾ãã
Google Colaboratoryã§ã¹ãã¬ã¼ã¸ã®ãã¼ã¿ãã¼ã¹ãã¡ã¤ã«ãæ±ã
Google Colaboratoryã§ãç´æ¥ãã¼ã¿ãã¼ã¹ãã¡ã¤ã«ãæ±ãæ¹æ³ã«ã¤ãã¦èª¬æãã¾ãã
é常ã¯ãDB4Sã®GUIã使ã£ãæ¹ã楽ã§ãããipynbãã¡ã¤ã«ã®ä¸é£ã®å®è¡ã®éä¸ã«ããã¼ã¿ãã¼ã¹ãæ±ãããã¨ããªã©ã«ä¾¿å©ã ã¨æãã¾ãã
次ããJupySQLã¨ããã©ã¤ãã©ãªã使ãã¾ãããåããããªãã¼ã«ã¨ãã¦ããipython-sqlãã¨ããã©ã¤ãã©ãªãããã¾ãã
ãã¡ãã¯å¤ããã¼ã«ã§ãä¸å
·åãå¤ãï¼ãã¼ãã«ä¸è¦§ãåç
§ã§ããªããªã©ï¼ã®ã§ãããã§ã¯ãJupySQLã使ã£ã¦ããã¾ãã
JupySQLã®ã¤ã³ã¹ãã¼ã«
!pip install jupysql duckdb-engine
JupySQLã§ã¹ãã¬ã¼ã¸ï¼ãã¼ã¿ãã¼ã¹ï¼ã®å
容ã確èªãã
ãã¼ã¿ãã¼ã¹ï¼optuna.dbï¼ã«æ¥ç¶ãã¾ãã
%load_ext sql
%sql sqlite:///optuna.db
å®è¡çµæ
Deploy Dash apps for free on Ploomber Cloud! Learn more: https://ploomber.io/s/signup
Connecting to 'sqlite:///optuna.db'
次ã«ãoptuna.dbã®ãã¼ãã«ã確èªãã¾ãã
%config SqlMagic.displaylimit = 30
%sql select name from sqlite_master where type='table';
å®è¡çµæ
Running query in 'sqlite:///optuna.db'
name
studies
version_info
study_directions
study_user_attributes
study_system_attributes
trials
trial_user_attributes
trial_system_attributes
trial_params
trial_values
trial_intermediate_values
trial_heartbeats
alembic_version
DB4Sã§ç¢ºèªããã®ã¨åæ§ã«ã13åã®ãã¼ãã«ã確èªã§ãã¾ããã
%sql
ãã¤ãã¦ãSQLæãå®è¡ããã°ãDB4Sã¨åæ§ã®æä½ãå¯è½ã§ãã
ä»åã¯ä»¥ä¸ã§ãï¼