Skip to content

eigen_tol in _spectral_embedding.py does not propagate to solvers other than arpack #21243

@lobpcg

Description

@lobpcg

Describe the bug

In _spectral_embedding.py the option

    eigen_tol : float, default=0.0
        Stopping criterion for eigendecomposition of the Laplacian matrix
        when ``eigen_solver='arpack'``.

does not appear to propagate to solvers 'amg' and 'lobpcg', e.g., adding eigen_tol and changing its value in examples/cluster/plot_coin_segmentation.py affects the outcome only if eigen_solver='arpack', which is the default but not for the other two: 'lobpcg' and 'amg'.

Steps/Code to Reproduce

See above

Expected Results

eigen_tol works for all supported solvers

Actual Results

eigen_tol works for `eigen_solver='arpack' only and is ignored otherwise

While at it

Also introduce and pass max_iter param to all eigen solvers, although maybe it should be named eigen_max_iter to avoid confusion.

Versions

System:
python: 3.7.3 (v3.7.3:ef4ec6ed12, Mar 25 2019, 22:22:05) [MSC v.1916 64 bit (AMD64)]
executable: C:\Users\Name\AppData\Local\Programs\Python\Python37\python.exe
machine: Windows-10-10.0.19041-SP0

Python dependencies:
pip: 21.2.4
setuptools: 58.1.0
sklearn: 1.0
numpy: 1.21.2
scipy: 1.7.1
Cython: 0.29.24
pandas: 1.3.3
matplotlib: 3.4.3
joblib: 1.0.1
threadpoolctl: 2.2.0

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions