Skip to content
プロジェクト

概要

UMAP次元削減法を実装したRパッケージです。

その他のプロジェクト

この数値の測り方

計測したスター増加

24時間
0
7日間
0
15日間
0
1か月
履歴を収集中

期間ごとの純増数です。期間は重複しており、日別の値ではありません。未計測の値は空欄です。スター数は注目度の指標であり、品質の保証ではありません。

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

関連プロジェクトを探す

読み込み中…