Skip to content
Proyectos

Acerca de

Paquete de R que implementa el método de reducción de dimensionalidad UMAP.

Otros proyectos

Cómo se miden estas cifras

Crecimiento de estrellas medido

in 24h
0
in 7 days
0
in 15 days
0
in 1 month
Recopilando historial

Cambios netos en períodos que se solapan, no totales diarios. Los datos no disponibles se dejan en blanco. Las estrellas indican interés, no calidad.

README.md

Original

uwot

R-CMD-check Coverage Status CRAN Status Badge Dependencies Downloads (monthly) Downloads (total) Last Commit

An R implementation of the Uniform Manifold Approximation and Projection (UMAP) method for dimensionality reduction of McInnes et al. (2018). Also included are the supervised and metric (out-of-sample) learning extensions to the basic method. Translated from the Python implementation.

News

August 29 2026 uwot version 0.2.5 has been released to CRAN. This is to apply fixes for some minor issues surfaced by CRAN checks (transitive headers in the C++ code caught by clang, a deprecation in test code) but there are some other minor changes for nearest neighbor calculations. See the NEWS.md for details.

Installing

From CRAN

install.packages("uwot")

From GitHub

Building the development version from source requires a C++17 compiler.

  • On Windows, install the Rtools version for your R release.
  • On macOS, install the Xcode Command Line Tools with xcode-select --install. The R for macOS tools page lists compilers for dependencies built from source.
  • On Linux, install R's development headers, make, and a C++17 compiler through your distribution.
install.packages("pak")
pak::pak("jlmelville/uwot")

Quick start

Embed the four measurements in R's built-in iris data, then plot one point per flower. The plotting symbols identify the species.

library(uwot)

iris_umap <- umap2(iris[, 1:4], seed = 42)
species <- iris$Species
plot(
  iris_umap,
  pch = as.integer(species),
  xlab = "UMAP 1",
  ylab = "UMAP 2"
)
legend(
  "topright",
  legend = levels(species),
  pch = seq_along(levels(species)),
  bty = "n"
)

MNIST example

To embed the 70,000 handwritten digits in MNIST, first install the snedata package from GitHub.

install.packages("pak")
pak::pak("jlmelville/snedata")

Download the data, fit UMAP to the pixel values, and color each point by its digit label.

mnist <- snedata::download_mnist()
mnist_umap <- uwot::umap(mnist, min_dist = 0.001, verbose = TRUE)
digit_colors <- grDevices::adjustcolor(rainbow(nlevels(mnist$Label)), alpha.f = 0.1)
plot(
  mnist_umap,
  cex = 0.1,
  col = digit_colors[mnist$Label],
  main = "R uwot::umap",
  xlab = "",
  ylab = ""
)

UMAP embedding of MNIST, colored by digit

Optional neighbor backends

For approximate nearest-neighbor search, install the package for the method you want to use.

install.packages(c("RcppHNSW", "rnndescent"))

Select HNSW or NN-Descent with nn_method. These examples use the built-in iris measurements.

iris_hnsw <- uwot::umap(iris[, 1:4], nn_method = "hnsw")
iris_nnd <- uwot::umap(iris[, 1:4], nn_method = "nndescent")

Documentation

https://jlmelville.github.io/uwot/. For more examples see the get started doc. There are plenty of articles describing various aspects of the package.

License

GPLv3 or later.

Citation

If you want to cite the use of uwot, then use the output of running citation("uwot") (you can do this with any R package).

See Also

Explorar proyectos relacionados

Cargando…