From 4db21b6945caca571b80ade7f7a482752c50e6f6 Mon Sep 17 00:00:00 2001 From: Alejandro Moreo Date: Wed, 8 May 2024 11:31:56 +0200 Subject: [PATCH] smoothing the prevalences in kld error function, bugfix --- quapy/error.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/quapy/error.py b/quapy/error.py index f2f5bd0..3e21333 100644 --- a/quapy/error.py +++ b/quapy/error.py @@ -158,8 +158,8 @@ def kld(prevs, prevs_hat, eps=None): :return: Kullback-Leibler divergence between the two distributions """ eps = __check_eps(eps) - smooth_prevs = prevs + eps - smooth_prevs_hat = prevs_hat + eps + smooth_prevs = smooth(prevs, eps) + smooth_prevs_hat = smooth(prevs_hat, eps) return (smooth_prevs*np.log(smooth_prevs/smooth_prevs_hat)).sum(axis=-1)