Skip to content

scikit-learn/sklearn/manifold/isomap.py could have a metric parameter for the nearest neighbors algorithm #9994

Closed

Description

@aarondbaron

Description

This is similar to issue #9868. There might be more to find, but the gist of the issue is that the manifold learning methods that make use of nearest neigbhors algorithm should also have a parameter for metric type. Nearest Neighbors accepts these:

Valid values for metric are:

from scikit-learn: [‘cityblock’, ‘cosine’, ‘euclidean’, ‘l1’, ‘l2’, ‘manhattan’]
from scipy.spatial.distance: [‘braycurtis’, ‘canberra’, ‘chebyshev’, ‘correlation’, ‘dice’, ‘hamming’, ‘jaccard’, ‘kulsinski’, ‘mahalanobis’, ‘matching’, ‘minkowski’, ‘rogerstanimoto’, ‘russellrao’, ‘seuclidean’, ‘sokalmichener’, ‘sokalsneath’, ‘sqeuclidean’, ‘yule’]

According to the documentation

Steps/Code to Reproduce

Expected Results

Actual Results

Versions

Activity

  1. jnothman commented on Oct 24, 2017

    @jnothman
    Member
  2. milongo commented on Nov 5, 2018

    @milongo

    I know it's been a while since this was opened, but I also need what @aarondbaron is describing. @jnothman asks whether other metrics are applicable to Isomap, and they do.

    The original article, "A Global Geometric Framework for Nonlinear Dimensionality Reduction", describes how the Isomap algorithm takes as input distances between all pairs of points "measured in either Euclidean space or in some domain-specific metric". The nearest neighbors graph is then constructed according to this distance matrix.

    Meaning as far as the input to the algorithm goes, it should be possible to input the matrix of dissimilarities, and build the shortest paths distance matrix according to this matrix. Then, classical MDS can be applied to construct the embedding in Euclidean space (i.e. minimize the Euclidean difference between distances of lower dimensionality points and higher dimensionality points).

  3. jnothman commented on Nov 6, 2018

    @jnothman
    Member

    Submit a pull request, @milongo?

  4. TomDLT commented on Sep 18, 2019

    @TomDLT
    Member

    Fixed in #10482

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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