From 11914a72fd64360cade1d097ffa44bc66c272813 Mon Sep 17 00:00:00 2001 From: Mohamed Maher Date: Thu, 14 May 2020 10:46:37 +0300 Subject: [PATCH] Update KDELogisticRegression.py --- KDELogisticRegression.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/KDELogisticRegression.py b/KDELogisticRegression.py index 30c1157..29f3d81 100644 --- a/KDELogisticRegression.py +++ b/KDELogisticRegression.py @@ -89,8 +89,8 @@ def smooth_labels(self, X, y): platt_pos = 1 / (N1 + 2) for i in range(len(y)): sample = X[i].reshape(1, -1) - score_pos = np.exp(self.pos_kde.score_samples(sample)) - score_neg = np.exp(self.neg_kde.score_samples(sample)) + score_pos = self.pos_kde.score_samples(sample) + score_neg = self.neg_kde.score_samples(sample) if y[i] > 0: y_smoothed[i] = 1 - platt_pos * score_pos / (score_pos + score_neg) else: @@ -132,4 +132,4 @@ def predict_ece_logloss(self, X, y, bins = 10): preds_probs = self.predict_proba(X) ece = ECE(bins) calibrated_score = ece.measure(preds_probs, y) - return calibrated_score, log_loss(y, preds_probs, labels = [0, 1]) \ No newline at end of file + return calibrated_score, log_loss(y, preds_probs, labels = [0, 1])