scikit-learn / scikit-learn

scikit-learn: machine learning in Python
https://scikit-learn.org
BSD 3-Clause "New" or "Revised" License
60.34k stars 25.44k forks source link

scikit-learn/sklearn/manifold/locally_linear.py could have a parameter for metric type #9868

Open aarondbaron opened 7 years ago

aarondbaron commented 7 years ago

Description

Local Linear Embedding uses distance metrics in the calculation of nearest neigbhors. it uses the NearestNeighbors class to do that. There doesnt seem to be a way to pass in the type of distance metric used. It uses a default of euclidean (or minkowski 2). It would be nice to pass in as a parameter different metrics to try, such as jaccard for categorical or whatever one would like.

Steps/Code to Reproduce

Expected Results

Actual Results

Versions

jnothman commented 7 years ago

Yes, I agree it looks like adding 'metric' and perhaps 'metric_params' should be possible. (but I'm not familiar with the algorithm)

achaldave commented 7 years ago

Hi, I'd like to take this up as my first contribution here.

CoderPat commented 7 years ago

I wouldn't mind to work on this one as well, if @achaldave isn't already

YashTD commented 7 years ago

@jnothman isn't it as straightforward as passing two additional arguments to NearestNeightbours? If so, I'd be happy to make this quick fix.

jnothman commented 7 years ago

I think so, but I'm not knowledgeable about the algorithm. You also need a test.

kamathhrishi commented 7 years ago

I would like to make my first contribution on this.

lesteve commented 7 years ago

@kamathhrishi there is already a PR on this one as you can see just above your post. Feel free to find another issue to work on, we have plenty of them ;-).

kamathhrishi commented 7 years ago

Thank you for your response.Z S

On 13 Oct 2017 2:23 p.m., "Loïc Estève" notifications@github.com wrote:

@kamathhrishi https://github.com/kamathhrishi there is already a PR on this one as you can see just above your post. Feel free to find another issue to work on, we have plenty of them ;-).

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/scikit-learn/scikit-learn/issues/9868#issuecomment-336391952, or mute the thread https://github.com/notifications/unsubscribe-auth/AFXGkZpJEsCDb4mWisBsJC4ob2CaydLsks5sryUmgaJpZM4Ps14u .