From b415eaf6d6af8a69fa0d292b53468f5f96707fe1 Mon Sep 17 00:00:00 2001 From: c-bata Date: Sun, 20 Mar 2022 01:37:01 +0900 Subject: [PATCH] Fix importance cache --- optuna_dashboard/_importance.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/optuna_dashboard/_importance.py b/optuna_dashboard/_importance.py index bfcfb358..dd67050d 100644 --- a/optuna_dashboard/_importance.py +++ b/optuna_dashboard/_importance.py @@ -60,7 +60,9 @@ def get_param_importance_from_trials_cache( cache_key = f"{study_id}:{objective_id}" with param_importance_cache_lock: - cache_n_trial, cache_importance = param_importance_cache.get(cache_key, [0, {}]) + cache_n_trial, cache_importance = param_importance_cache.get( + cache_key, [0, {"target_name": target_name, "param_importances": []}] + ) if n_completed_trials == cache_n_trial: return cache_importance