File tree Expand file tree Collapse file tree 3 files changed +13
-7
lines changed
Expand file tree Collapse file tree 3 files changed +13
-7
lines changed Original file line number Diff line number Diff line change @@ -46,7 +46,7 @@ install_requires =
4646 torch>=1.10.0
4747 numpy>=1.20
4848 catboost>=1.0.5
49- optuna>=2.10
49+ optuna>=3.1
5050 loguru ==.0.6.0
5151 xgboost>=1.6.1
5252 miracle-imputation>=0.1.3
Original file line number Diff line number Diff line change 44
55# third party
66import optuna
7+ from optuna .storages import JournalRedisStorage , JournalStorage
78import redis
89
910# hyperimpute absolute
@@ -21,17 +22,16 @@ def __init__(
2122 ):
2223 self .url = f"redis://{ host } :{ port } /"
2324
24- self ._optuna_storage = optuna . storages . RedisStorage ( url = self .url )
25+ self ._optuna_storage = JournalStorage ( JournalRedisStorage ( url = self .url ) )
2526 self ._client = redis .Redis .from_url (self .url )
2627
27- def optuna (self ) -> optuna . storages . RedisStorage :
28+ def optuna (self ) -> JournalStorage :
2829 return self ._optuna_storage
2930
3031 def client (self ) -> redis .Redis :
3132 return self ._client
3233
3334
34- backend = RedisBackend ()
3535threshold = 40
3636
3737
@@ -104,7 +104,11 @@ def create_study(
104104 patience : int = threshold ,
105105) -> Tuple [optuna .Study , ParamRepeatPruner ]:
106106
107- storage_obj = backend .optuna ()
107+ try :
108+ backend = RedisBackend ()
109+ storage_obj = backend .optuna ()
110+ except BaseException :
111+ storage_obj = None
108112
109113 try :
110114 study = optuna .create_study (
Original file line number Diff line number Diff line change 1- __version__ = "0.1.12"
2- MAJOR_VERSION = "0.1"
1+ __version__ = "0.1.13"
2+
3+ MAJOR_VERSION = "." .join (__version__ .split ("." )[:- 1 ])
4+ MINOR_VERSION = __version__ .split ("." )[- 1 ]
You can’t perform that action at this time.
0 commit comments