-
-
Notifications
You must be signed in to change notification settings - Fork 26.9k
Overflow Runtime Warning for Numpy Logistic Function in CalibratedClassifierCV with SVM #12896
Description
Description
Overflow Runtime Warning for Numpy Logistic Function in CalibratedClassifierCV with SVM
Steps/Code to Reproduce
Training a soft-margin SVM inside a CalibrationClassifierCV using sigmoid (Platt) scaling. Below is the definition of the classifier:
g_svm = svm.SVC(gamma='auto') g = CalibratedClassifierCV(g_svm, method='sigmoid', cv=10)
I am not able to share the dataset publicly. I could try to create a synthetic one if it is useful/needed. The warning is intermittent.
Expected Results
No runtime warning is reported.
Actual Results
/sklearn/calibration.py:520: RuntimeWarning: overflow encountered in exp
return 1. / (1. + np.exp(self.a_ * T + self.b_))
Versions
System:
python: 3.7.1 (default, Dec 12 2018, 01:02:44) [Clang 10.0.0 (clang-1000.11.45.5)]
executable:
machine: Darwin-18.2.0-x86_64-i386-64bit
BLAS:
macros: NO_ATLAS_INFO=3, HAVE_CBLAS=None
lib_dirs:
cblas_libs: cblas
Python deps:
pip: 18.1
setuptools: 39.0.1
sklearn: 0.20.1
numpy: 1.15.4
scipy: 1.1.0
Cython: None
pandas: 0.23.4