8000 FIX: tol in _spectral_embedding.py (#21194) · scikit-learn/scikit-learn@8b18d4c · GitHub
[go: up one dir, main page]

Skip to content

Commit 8b18d4c

Browse files
authored
FIX: tol in _spectral_embedding.py (#21194)
1 parent 6b332d9 commit 8b18d4c

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

doc/whats_new/v1.0.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -676,6 +676,10 @@ Changelog
676676
every infinite distances to zero. :pr:`20531` by `Roman Yurchak`_ and `Tom
677677
Dupre la Tour`_.
678678

679+
- |Fix| Decrease the numerical default tolerance in the lobpcg call
680+
in :func:`manifold.spectral_embedding` to prevent numerical instability.
681+
:pr:`21194` by :user:`Andrew Knyazev <lobpcg>`.
682+
679683
:mod:`sklearn.metrics`
680684
......................
681685

sklearn/manifold/_spectral_embedding.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,7 @@ def spectral_embedding(
367367
X = random_state.rand(laplacian.shape[0], n_components + 1)
368368
X[:, 0] = dd.ravel()
369369
_, diffusion_map = lobpcg(
370-
laplacian, X, tol=1e-15, largest=False, maxiter=2000
370+
laplacian, X, tol=1e-5, largest=False, maxiter=2000
371371
)
372372
embedding = diffusion_map.T[:n_components]
373373
if norm_laplacian:

0 commit comments

Comments
 (0)
0