Skip to content

Commit 9094078

Browse files
committed
Switching from np to math for scalar float ops
1 parent 4a4d8e7 commit 9094078

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

sklearn/isotonic.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
from .utils import as_float_array, check_arrays
1111
from ._isotonic import _isotonic_regression
1212
import warnings
13+
import math
1314

1415

1516
def check_increasing(x, y):
@@ -54,13 +55,13 @@ def check_increasing(x, y):
5455

5556
# Run Fisher transform to get the rho CI, but handle rho=+/-1
5657
if rho not in [-1.0, 1.0]:
57-
F = 0.5 * np.log((1 + rho) / (1 - rho))
58-
F_se = 1 / np.sqrt(len(x) - 3)
58+
F = 0.5 * math.log((1. + rho) / (1. - rho))
59+
F_se = 1 / math.sqrt(len(x) - 3)
5960

6061
# Use a 95% CI, i.e., +/-1.96 S.E.
6162
# http://en.wikipedia.org/wiki/Fisher_transformation
62-
rho_0 = np.tanh(F - 1.96 * F_se)
63-
rho_1 = np.tanh(F + 1.96 * F_se)
63+
rho_0 = math.tanh(F - 1.96 * F_se)
64+
rho_1 = math.tanh(F + 1.96 * F_se)
6465

6566
# Warn if the CI spans zero.
6667
if np.sign(rho_0) != np.sign(rho_1):

0 commit comments

Comments
 (0)