Skip to content

Commit

Permalink
Update to change factorial
Browse files Browse the repository at this point in the history
  • Loading branch information
Carole Sudre authored and Carole Sudre committed Sep 26, 2024
1 parent c8b9f21 commit 033fa55
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion MetricsReloaded/metrics/calibration_measures.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@


import numpy as np
import math
from scipy.special import gamma

# from metrics.pairwise_measures import CacheFunctionOutput
Expand Down Expand Up @@ -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

Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
numpy
math
scipy
scikit-learn
scikit-image
Expand Down

0 comments on commit 033fa55

Please sign in to comment.