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

Fixed n_jobs errors for umap-learn #23

Merged
merged 5 commits into from
Apr 29, 2024
Merged

Fixed n_jobs errors for umap-learn #23

merged 5 commits into from
Apr 29, 2024

Conversation

pteridin
Copy link

The warning UserWarning: n_jobs value -1 overridden to 1 by setting random_state. Use no seed for parallelism. occurs even when random_state is not set (= NA).

reticulate::use_condaenv("r-reticulate")
reticulate::py_install("umap-learn")

set.seed(123)
ds_train <- matrix(nrow = 1000,
                   ncol = 50,
                   runif(1000 * 50))

umap_model <- umap::umap(ds_train,
                         method = "umap-learn",
                         n_neighbors = 2,
                         n_components = 2,
                         metric = "cosine",
                         min_dist = .1,
                         spread = 1,
                         n_jobs = 12L,
                         
                         init = "random",
                         random_state = NA,
                         transform_state = NA,
                         verbose = TRUE)

This request fixes the error messages and allows parallel jobs.

Tobias Heidler added 4 commits April 25, 2024 08:11
"UserWarning: n_jobs value 1 overridden to 1 by setting random_state. Use no seed for parallelism.", even when random_state is NA
@tkonopka
Copy link
Owner

Thank you @pteridin! This will be a useful feature.

I'll test this out and take a closer look at the weekend. In meantime, could I ask you please to bump the version number more, to 0.2.11.0? (I used the last digit only for attempts at cran submits)

@pteridin
Copy link
Author

No problem.

Though, I must say that in my small little experiments: n_jobs>1 does not really bump the overall performance as much as I would have expected.

@tkonopka
Copy link
Owner

Code looks good, test suite passes, warning goes away for umap-learn (v0.5.6), and seeding is still active otherwise.

Great work, thank you for the contribution!

@tkonopka tkonopka merged commit 9106cac into tkonopka:master Apr 29, 2024
2 of 8 checks passed
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

Successfully merging this pull request may close these issues.

2 participants