From 033fa55bcb2dcd5c418c8918b1776845191088b9 Mon Sep 17 00:00:00 2001 From: Carole Sudre Date: Thu, 26 Sep 2024 17:17:20 +0100 Subject: [PATCH] Update to change factorial --- MetricsReloaded/metrics/calibration_measures.py | 3 ++- requirements.txt | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/MetricsReloaded/metrics/calibration_measures.py b/MetricsReloaded/metrics/calibration_measures.py index 27104d3..5874f9f 100644 --- a/MetricsReloaded/metrics/calibration_measures.py +++ b/MetricsReloaded/metrics/calibration_measures.py @@ -29,6 +29,7 @@ import numpy as np +import math from scipy.special import gamma # from metrics.pairwise_measures import CacheFunctionOutput @@ -235,7 +236,7 @@ def kernel_calibration_error(self): vect_j = one_hot_ref[j,:] - self.pred[j,:] value_ij = np.matmul(vect_i, np.matmul(kernel,vect_j.T)) sum_tot += value_ij - multiplicative_factor = np.math.factorial(numb_samples)/ (2 * np.math.factorial(numb_samples-2)) + multiplicative_factor = math.factorial(numb_samples)/ (2 * np.math.factorial(numb_samples-2)) kce = 1/multiplicative_factor * sum_tot return kce diff --git a/requirements.txt b/requirements.txt index 73287ff..f11fb4d 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,5 @@ numpy +math scipy scikit-learn scikit-image