Skip to content

Commit d9d02aa

Browse files
committed
COSMIT get rid of warning from expit import
1 parent ac8cbb1 commit d9d02aa

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

sklearn/utils/fixes.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,9 @@
2727

2828
try:
2929
from scipy.special import expit # SciPy >= 0.10
30-
if np.isnan(expit(1000)): # SciPy < 0.14
31-
raise ImportError("no stable expit in scipy.special")
30+
with np.errstate(invalid='ignore', over='ignore'):
31+
if np.isnan(expit(1000)): # SciPy < 0.14
32+
raise ImportError("no stable expit in scipy.special")
3233
except ImportError:
3334
def expit(x, out=None):
3435
"""Logistic sigmoid function, ``1 / (1 + exp(-x))``.

0 commit comments

Comments
 (0)