Giter VIP home page Giter VIP logo

Comments (4)

lmcinnes avatar lmcinnes commented on April 28, 2024

No that's certainly quite feasible, the only catch being that you have to have computed the distance matrix first. I would be happy to work though and merge a pull request if you want to put in the work. Thanks!

from umap.

LGro avatar LGro commented on April 28, 2024

Sure, should be helpful in the cases where people have precomputed distance matrices due to large computation times and re-use the distance matrix.
I have a working implementation already (results look very nice with UMAP!) and will submit a pull request in the upcoming days.

So far I have added a precomputed flag to make_nn_descent that is set when the given metric is set to the string "precomputed". However, I'm still struggling with what to do with the distance function in that case, because it seems like it expects a numba function in any case.
Would you prefer a flag that changes the behaviour or a dummy distance function named precomputed that is then checked for its name in nn_descent?
Maybe we can come up with an even more elegant way.

If I couldn't make clear what I mean, just wait for my pull request and we can discuss the actual code.

from umap.

lmcinnes avatar lmcinnes commented on April 28, 2024

I think adding a dummy distance function called precomputed to distance.py is probably the better way to go under those options (would likely have less code duplication).

Since you have the full distance matrix, however, could you not compute the nearest neighbors by an argsort across an index of the distance matrix? That might save you having to mess with nn_descent at all. Then again, if you have something that works I'm not really going to argue.

Looking forward to the PR.

from umap.

LGro avatar LGro commented on April 28, 2024

You are right, that's more elegant and faster.

from umap.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.