From 940e7087290ce9351b8878758aee1b6cd52a5315 Mon Sep 17 00:00:00 2001 From: ronilpatil Date: Sat, 23 Mar 2024 13:21:46 +0530 Subject: [PATCH] bug fix in hyperopt-fmin --- src/models/tune_model.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/models/tune_model.py b/src/models/tune_model.py index 119fe73..cff63fe 100644 --- a/src/models/tune_model.py +++ b/src/models/tune_model.py @@ -86,7 +86,10 @@ def main() -> None : 'max_depth': hp.choice('max_depth', np.arange(4, 12, dtype = int)), 'min_samples_split': hp.choice('min_samples_split', np.arange(15, 50, dtype = int)), 'min_samples_leaf': hp.choice('min_samples_leaf', np.arange(15, 100, dtype = int)) } - try : + try : + # hp.choice return index not the actual value of parameter + # to convert indices into value use return_argmin = False + # or use space_eval(search_space, best_result) best_result = fmin(fn = partial_obj, space = search_space, algo = tpe.suggest,