From 32e2ffeaf6bd0918b7de713b8df708ba6b377fdd Mon Sep 17 00:00:00 2001 From: tkchafin Date: Wed, 15 May 2024 13:23:11 +0100 Subject: [PATCH] bug in univariate gridsearch --- src/resistnet/model_optimisation.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/resistnet/model_optimisation.py b/src/resistnet/model_optimisation.py index 33d3a69c..d0b93c78 100644 --- a/src/resistnet/model_optimisation.py +++ b/src/resistnet/model_optimisation.py @@ -953,7 +953,7 @@ def optimise_univariate(self, fitmetric="aic", threads=1, df = pd.DataFrame(results_data) for var in self.resistance_network.variables: var_df = df[df['variable'] == var] - best = var_df.loc[var_df['fitness'] == var_df['fitness'].min()] + best = var_df.loc[var_df['fitness'] == var_df['fitness'].max()] best = best.sort_values(by=['shape', 'transform']).iloc[0] best_params[var] = { 'transform': best['transform'],