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

Error with n_components=1 #4

Closed
mbosio85 opened this issue Sep 28, 2018 · 3 comments
Closed

Error with n_components=1 #4

mbosio85 opened this issue Sep 28, 2018 · 3 comments

Comments

@mbosio85
Copy link

Hello,
I am trying to use umap in R and wanted to try editing the configuration n_components to 1.
When I do it I get an error :

custom.config = umap.defaults
custom.config$n_components=1
aa.umap = umap(aa, config = custom.config)
Error in result[, 1:d, drop = FALSE] : incorrect number of dimensions

Is there a way I can extract a reduction to only 1 component ?

Thanks for the info
Mattia

@tkonopka
Copy link
Owner

Thanks for the report.

In principle, it should be possible to use n_components=1. For example, it works on the iris dataset.

umap(iris[,1:4], n_components=1)

outputs

umap embedding of 150 items in 1 dimensions
object components: layout, data, knn, config

However, there are indeed cases where things break. For example,

umap(iris[1:5,1:4], n_neighbors=3, n_components=1)

outputs an error. I'll post an update...

@tkonopka
Copy link
Owner

Posted an update that fixes the bug (at least with the example with the iris dataset).

@tkonopka
Copy link
Owner

tkonopka commented Oct 3, 2018

I'll take it the patch resolves the original question. But please re-open the issue if you encounter further issues.

Thanks again for reporting the bug.

@tkonopka tkonopka closed this as completed Oct 3, 2018
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