Skip to content

Commit

Permalink
Recommend installing rcpphnsw and rnndescent
Browse files Browse the repository at this point in the history
  • Loading branch information
jlmelville committed Apr 14, 2024
1 parent ee47525 commit 5d72d0c
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion vignettes/articles/umap2.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ that feature, so this is a good trade-off.
* If you set `a = 1, b = 1` (and you don't specify `dens_scale`), then the
faster `tumap` gradient will be used.

These are not big changes so don't expect large differences in behavior. I'll
These are not big changes so don't expect large differences in behavior, but I
do strongly recommend installing (and loading) `RcppHNSW` and `rnndescent`. I'll
use the MNIST digits for a comparison. Use the `snedata` package from github for
this:

Expand All @@ -74,11 +75,23 @@ Now let's run `umap` and `umap2` on the MNIST data using their defaults.

```{r umap}
library(uwot)
set.seed(42)
mnist_umap <- umap(mnist)
```

Install `RcppHNSW` and `rnndescent` if you haven't already.

```{r install RcppHNSW and rnndescent}
install.packages(c("RcppHNSW", "rnndescent"))
```

With these libraries installed `umap2` will use `RcppHNSW` by default.

```{r umap2}
library(RcppHNSW)
library(rnndescent)
set.seed(42)
mnist_umap2 <- umap2(mnist)
```
Expand Down

0 comments on commit 5d72d0c

Please sign in to comment.