From: Jérôme Benoit Date: Tue, 27 May 2025 14:03:09 +0000 (+0200) Subject: refactor(qav3): use scipy gmean X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=320a547c29c567667d8c61a1515add2fbca3fa7e;p=freqai-strategies.git refactor(qav3): use scipy gmean Signed-off-by: Jérôme Benoit --- diff --git a/quickadapter/user_data/freqaimodels/QuickAdapterRegressorV3.py b/quickadapter/user_data/freqaimodels/QuickAdapterRegressorV3.py index 7e0d167..b2fe5a5 100644 --- a/quickadapter/user_data/freqaimodels/QuickAdapterRegressorV3.py +++ b/quickadapter/user_data/freqaimodels/QuickAdapterRegressorV3.py @@ -469,10 +469,8 @@ class QuickAdapterRegressorV3(BaseRegressionModel): ) ) elif metric == "geometric_mean": - # 1.0 = np.prod(ideal_point) ** (1.0 / ideal_point.shape[0]) - return 1.0 - np.prod(normalized_matrix, axis=1) ** ( - 1.0 / normalized_matrix.shape[1] - ) + # 1.0 = sp.stats.gmean(ideal_point) + return 1.0 - sp.stats.gmean(normalized_matrix, axis=1) elif metric == "hypervolume": # 1.0 = np.prod(ideal_point) return 1.0 - np.prod(normalized_matrix, axis=1)