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

umap transform fuzzy graph #104

Closed
PedroMilanezAlmeida opened this issue Oct 28, 2022 · 3 comments
Closed

umap transform fuzzy graph #104

PedroMilanezAlmeida opened this issue Oct 28, 2022 · 3 comments
Labels
enhancement New feature or request

Comments

@PedroMilanezAlmeida
Copy link

I was just wondering if umap_transform produces a fuzzy graph (with or without the reference points) and if this "transformed" fuzzy graph is/could be returned as well.

Any help would be much appreciated.

@jlmelville
Copy link
Owner

jlmelville commented Oct 28, 2022

It does internally create the fuzzy graph but it doesn't output it, sorry.

It should be possible to add this functionality without too much difficulty though.

@jlmelville jlmelville added the enhancement New feature or request label Oct 28, 2022
@jlmelville
Copy link
Owner

@PedroMilanezAlmeida I just pushed a change to the master branch so the development version of uwot will now return the fuzzy graph used for transforming if you pass ret_extra = c("fgraph") , e.g.:

iris_train <- iris[1:100, ]
iris_test <- iris[101:150, ]

iris_train_umap <- umap(iris_train, ret_model = TRUE)
iris_test_umap <- umap_transform(iris_test, iris_train_umap, ret_extra = c("fgraph"))

iris_test_umap$embedding # the coordinates
iris_test_umap$fgraph # the fuzzy graph

the returned fuzzy graph has as many rows as there are items in the new data to transform, and as many columns as there were items in the data used to build the model, so in the example above dim(iris_test_umap$fgraph) == c(50, 100).

This will eventually appear in the next CRAN release (which is unlikely to be submitted before the end of the year).

@PedroMilanezAlmeida
Copy link
Author

@jlmelville

Thank you very much for your quick reply and solution. I appreciate it! I'll close this for now and, in the unlikely event of running into any issues, I'll let you know. Thanks again!

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

No branches or pull requests

2 participants