-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make nn algorithm configurable #281
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a comment regarding allowed algorithms.
lib/scholar/manifold/trimap.ex
Outdated
@@ -113,6 +113,16 @@ defmodule Scholar.Manifold.Trimap do | |||
doc: ~S""" | |||
Metric used to compute the distances. | |||
""" | |||
], | |||
algorithm: [ | |||
type: {:in, [:nndescent, :large_vis]}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would add at least :brute
. Maybe custom k-NN graph construction algorithm to be passed as a module as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there any benefit in using brute other than nndescent or large_vis?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd say it's the best one to use for smaller datasets.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps making the selection automatic depending on dataset size (sample size and number of features) would be ideal.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will force use brute for n < 100
and otherwise one of these two approximated algorithms, is it ok or do we want to add :brute
anyway?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe use brute-force for
I would add :brute
anyway; it might be useful to see how much the quality of embeddings differ when approximate k-NN search algorithms are used.
Looking at it now, we might wanna change predict
to transform
in these algorithms as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good to me.
Function that computes the Trimap is called |
Co-authored-by: José Valim <[email protected]>
Yeah, I will change the name to |
…m:msluszniak/scholar into custom_nn_trimap
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two small comments.
Perhaps renaming algorithm
to knn_algorithm
would make it more understandable? Up to you.
Looks good to me! If you want, I can have a more detailed look tomorrow. Otherwise, feel free to merge it. I hope I am not annoying with these comments. ^_^ |
Your comments is a valueable feedback for me, so don't stop 😀 |
Closes #280