8000 FIX call check_array in Nystroem fit & transform · scikit-learn/scikit-learn@090ad08 · GitHub
[go: up one dir, main page]

Skip to content

Commit 090ad08

Browse files
committed
FIX call check_array in Nystroem fit & transform
1 parent 7805ec7 commit 090ad08

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

sklearn/kernel_approximation.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -437,10 +437,8 @@ def fit(self, X, y=None):
437437
X : array-like, shape=(n_samples, n_feature)
438438
Training data.
439439
"""
440-
440+
X = check_array(X, accept_sparse='csr')
441441
rnd = check_random_state(self.random_state)
442-
if not sp.issparse(X):
443-
X = np.asarray(X)
444442
n_samples = X.shape[0]
445443

446444
# get basis vectors
@@ -487,6 +485,7 @@ def transform(self, X):
487485
Transformed data.
488486
"""
489487
check_is_fitted(self, 'components_')
488+
X = check_array(X, accept_sparse='csr')
490489

491490
kernel_params = self._get_kernel_params()
492491
embedded = pairwise_kernels(X, self.components_,

0 commit comments

Comments
 (0)
0