Skip to content

Commit 17c9196

Browse files
committed
formatting/error fixes
1 parent 5375a48 commit 17c9196

File tree

2 files changed

+11
-12
lines changed

2 files changed

+11
-12
lines changed

sklearn/decomposition/tests/test_pca.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,8 @@ def test_pca_validation(solver):
358358
# parameter raise errors
359359
X = np.array([[0, 1, 0], [1, 0, 0]])
360360
smallest_d = 2 # The smallest dimension
361-
lower_limit = {'randomized': 1, 'arpack': 1, 'full': 0, 'auto': 0}
361+
lower_limit = {'randomized': 1, 'arpack': 1, 'lobpcg': 1,
362+
'full': 0, 'auto': 0}
362363

363364
# We conduct the same test on X.T so that it is invariant to axis.
364365
for data in [X, X.T]:

sklearn/utils/lobpcg.py

+9-11
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,14 @@
11
"""
2-
Pure SciPy implementation of Locally Optimal Block Preconditioned Conjugate
3-
Gradient Method (LOBPCG), see
4-
https://bitbucket.org/joseroman/blopex
5-
6-
The original code is at scipy\sparse\linalg\eigen\lobpcg\lobpcg.py
2+
Locally Optimal Block Preconditioned Conjugate Gradient Method (LOBPCG)
3+
"""
74

8-
License: BSD
5+
# sk-learn copy of scipy\sparse\linalg\eigen\lobpcg\lobpcg.py
96

10-
Authors: Robert Cimrman, Andrew Knyazev
7+
# Author: Robert Cimrman,
8+
# Andrew Knyazev
9+
# Examples in tests directory contributed by Nils Wagner.
10+
# License: BSD
1111

12-
Examples in tests directory contributed by Nils Wagner.
13-
"""
1412
import numpy as np
1513

1614
from numpy.testing import assert_allclose
@@ -472,9 +470,9 @@ def lobpcg(A, X,
472470
[xbp.T.conj(), wbp.T.conj(), ident]])
473471
else:
474472
gramA = np.bmat([[np.diag(_lambda), xaw],
475-
[xaw.T.conj(), waw]])
473+
[xaw.T.conj(), waw]])
476474
gramB = np.bmat([[ident0, xbw],
477-
[xbw.T.conj(), ident]])
475+
[xbw.T.conj(), ident]])
478476

479477
if verbosityLevel > 10:
480478
save(gramA, 'gramA')

0 commit comments

Comments
 (0)