Testing error in production
This commit is contained in:
parent
d6c632a361
commit
24ca5a885c
|
@ -1,7 +1,11 @@
|
||||||
import logging
|
import logging
|
||||||
|
import sys
|
||||||
import numpy as np
|
import numpy as np
|
||||||
|
|
||||||
|
|
||||||
|
logging.basicConfig(stream=sys.stdout)
|
||||||
|
|
||||||
|
|
||||||
# This function is a sklearn.calibration.calibration_curve modification
|
# This function is a sklearn.calibration.calibration_curve modification
|
||||||
def calibration_curve(y_true, y_prob, *, n_bins=5, strategy="uniform"):
|
def calibration_curve(y_true, y_prob, *, n_bins=5, strategy="uniform"):
|
||||||
y_true = np.array(y_true)
|
y_true = np.array(y_true)
|
||||||
|
@ -23,6 +27,9 @@ def calibration_curve(y_true, y_prob, *, n_bins=5, strategy="uniform"):
|
||||||
|
|
||||||
try:
|
try:
|
||||||
binids = np.digitize(y_prob, bins) - 1
|
binids = np.digitize(y_prob, bins) - 1
|
||||||
|
|
||||||
|
raise ValueError
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
np.set_printoptions(threshold=sys.maxsize)
|
np.set_printoptions(threshold=sys.maxsize)
|
||||||
logging.info("=" * 40)
|
logging.info("=" * 40)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user