8000 change to check isspmatrix · scikit-learn/scikit-learn@180013a · GitHub
[go: up one dir, main page]

Skip to content

Commit 180013a

Browse files
committed
change to check isspmatrix
1 parent ea05f4c commit 180013a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

sklearn/feature_selection/_univariate_selection.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
import numpy as np
1212
from scipy import special, stats
13-
from scipy.sparse import issparse
13+
from scipy.sparse import issparse, isspmatrix
1414

1515
from ..base import BaseEstimator, _fit_context
1616
from ..preprocessing import LabelBinarizer
@@ -323,7 +323,7 @@ def r_regression(X, y, *, center=True, force_finite=True):
323323
# need not center X
324324
if center:
325325
y = y - np.mean(y)
326-
if issparse(X):
326+
if isspmatrix(X):
327327
X_means = X.mean(axis=0).getA1()
328328
else:
329329
X_means = X.mean(axis=0)

0 commit comments

Comments
 (0)
0