From 66ad7295dfe9e250df6c516789a359bdea4150eb Mon Sep 17 00:00:00 2001 From: Alejandro Moreo Date: Wed, 8 Nov 2023 18:11:45 +0100 Subject: [PATCH] fix in DistributionMatchingX --- quapy/method/non_aggregative.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/quapy/method/non_aggregative.py b/quapy/method/non_aggregative.py index 2f19b9e..8768c92 100644 --- a/quapy/method/non_aggregative.py +++ b/quapy/method/non_aggregative.py @@ -137,8 +137,9 @@ class DistributionMatchingX(BaseQuantifier): def __get_distributions(self, X): histograms = [] for feat_idx in range(self.nfeats): - hist = np.histogram(X[:, feat_idx], bins=self.nbins, density=True, range=self.feat_ranges[feat_idx])[0] - histograms.append(hist) + hist = np.histogram(X[:, feat_idx], bins=self.nbins, range=self.feat_ranges[feat_idx])[0] + normhist = hist / hist.sum() + histograms.append(normhist) distributions = np.vstack(histograms) if self.cdf: