Skip to content
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

return model with precalculated nearest neighbor #63

Closed
yuhanH opened this issue Jul 16, 2020 · 2 comments
Closed

return model with precalculated nearest neighbor #63

yuhanH opened this issue Jul 16, 2020 · 2 comments

Comments

@yuhanH
Copy link

yuhanH commented Jul 16, 2020

Hi,
I noticed that umap cannot return a model with precalculated nearest neighbor input in nn_method.

I would propose that modifications of two parts will enable umap to return the model with precalculated nearest neighbor input.

part1:

uwot/R/uwot.R

Line 1656 in cbb78b5

scale_info = attr_to_scale_info(X),

scale_info = if (!is.null(X)) { attr_to_scale_info(X) } else { NULL },

part2:

uwot/R/uwot.R

Line 1687 in cbb78b5

res$metric[[1]] <- list(ndim = length(res$nn_index$getItemsVector(0)))

    if(!is.null(X)){
            res$metric[[1]] <- list(ndim = length(res$nn_index$getItemsVector(0)))
          } else{
            res$metric[[1]] <- list()
          }

Happy to put a PR for this if people agree.

@jlmelville
Copy link
Owner

Hi @yuhanH, uwot doesn't return a model when using precalculated nearest neighbors, because you can't transform new points with just that information. If you think there is a use for the model without that I would be happy to look at a PR, but can you explain a use case?

@yuhanH yuhanH mentioned this issue Jul 17, 2020
@jlmelville
Copy link
Owner

Closed by #64

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants