8000 #5778: Changed min and max of csr/csc to use np.float64 conversion · scikit-learn/scikit-learn@559ec05 · GitHub
[go: up one dir, main page]

Skip to content

Commit 559ec05

Browse files
committed
#5778: Changed min and max of csr/csc to use np.float64 conversion
1 parent 021818e commit 559ec05

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

sklearn/utils/sparsefuncs.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,7 @@ def csr_csc_min_axis0(X):
4040
The minimum of elements along axis 0.
4141
"""
4242

43-
# TODO: I don't know how to avoid this call to `astype()`;
44-
# my test cases don't pass with integers otherwise.
45-
X = X.astype(float)
43+
X = X.astype(np.float64)
4644
if isinstance(X, sp.csr_matrix):
4745
return csr_min_axis0(X)
4846
elif isinstance(X, sp.csc_matrix):
@@ -64,9 +62,7 @@ def csr_csc_max_axis0(X):
6462
The maximum of elements along axis 0.
6563
"""
6664

67-
# TODO: I don't know how to avoid this call to `astype()`;
68-
# my test cases don't pass with integers otherwise.
69-
X = X.astype(float)
65+
X = X.astype(np.float64)
7066
if isinstance(X, sp.csr_matrix):
7167
return csr_max_axis0(X)
7268
elif isinstance(X, sp.csc_matrix):

0 commit comments

Comments
 (0)
0