From e4ad3bbc4ce7a009ad1f2e84ed65db431e8ddcc4 Mon Sep 17 00:00:00 2001 From: ryota717 Date: Fri, 11 Oct 2024 17:43:14 +0900 Subject: [PATCH] refactor: Delete unnecessary max operation. --- package/samplers/mab_epsilon_greedy/mab_epsilon_greedy.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package/samplers/mab_epsilon_greedy/mab_epsilon_greedy.py b/package/samplers/mab_epsilon_greedy/mab_epsilon_greedy.py index d10c5668..796d6dc6 100644 --- a/package/samplers/mab_epsilon_greedy/mab_epsilon_greedy.py +++ b/package/samplers/mab_epsilon_greedy/mab_epsilon_greedy.py @@ -62,10 +62,10 @@ def sample_independent( if study.direction == StudyDirection.MINIMIZE: return min( param_distribution.choices, - key=lambda x: rewards_by_choice[x] / max(cnt_by_choice[x], 1), + key=lambda x: rewards_by_choice[x] / cnt_by_choice[x], ) else: return max( param_distribution.choices, - key=lambda x: rewards_by_choice[x] / max(cnt_by_choice[x], 1), + key=lambda x: rewards_by_choice[x] / cnt_by_choice[x], )