Skip to content
프로젝트

소개

UMAP 차원 축소 방법을 구현한 R 패키지입니다.

기타 프로젝트

이 수치를 측정하는 방법

측정된 스타 증가

in 24h
0
in 7 days
0
in 15 days
0
in 1 month
기록 수집 중

서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.

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

관련 프로젝트 살펴보기

불러오는 중…