Avoid to calculate importance when only available single trial

This commit is contained in:
c-bata
2023-01-23 11:37:44 +09:00
parent 29233909a2
commit f1e4724f50
+1 -1
View File
@@ -86,7 +86,7 @@ def get_param_importance_from_trials_cache(
) -> list[ImportanceType]:
completed_trials = [t for t in trials if t.state == TrialState.COMPLETE]
n_completed_trials = len(completed_trials)
if n_completed_trials == 0:
if n_completed_trials <= 1:
return []
cache_key = f"{study_id}:{objective_id}"