Skip to content
Back to skills

Umap

ASecurity

R umap package for UMAP. Use for Uniform Manifold Approximation and Projection visualization.

  • 5 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added June 4, 2026
datapython

Works with

  • cli

Security analysis

A100/100

Scanned June 4, 2026

npx -y skills add LeoLin990405/r-analytics-skill --skill umap --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Umap?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Umap
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/leolin990405-umap/badge)](https://www.skillsdirectory.com/skills/leolin990405-umap)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: umap
description: R umap package for UMAP. Use for Uniform Manifold Approximation and Projection visualization.
---

# umap

Uniform Manifold Approximation and Projection.

## Basic Usage

```r
library(umap)

# Run UMAP
um <- umap(data)

# Results
um$layout  # 2D coordinates

# Plot
plot(um$layout, col = labels, pch = 19)
```

## Configuration

```r
# Custom configuration
config <- umap.defaults
config$n_neighbors <- 15
config$min_dist <- 0.1
config$metric <- "euclidean"
config$n_epochs <- 200

um <- umap(data, config = config)
```

## Parameters

```r
um <- umap(data,
  n_neighbors = 15,    # Local neighborhood size

  n_components = 2,    # Output dimensions
  metric = "euclidean",
  n_epochs = 200,
  min_dist = 0.1,      # Minimum distance in embedding
  spread = 1,
  random_state = 42
)
```

## Methods

```r
# R implementation (default)
um <- umap(data, method = "naive")

# Python implementation (requires reticulate)
um <- umap(data, method = "umap-learn")
```

## Predict New Data

```r
# Fit UMAP
um <- umap(train_data)

# Transform new data
new_coords <- predict(um, new_data)
```

## From Distance Matrix

```r
# Compute distances
d <- as.matrix(dist(data))

# UMAP from distances
um <- umap(d, input = "dist")
```

## Supervised UMAP

```r
# With labels
um <- umap(data, labels = labels)
```

## With ggplot2

```r
library(ggplot2)

umap_df <- data.frame(
  x = um$layout[, 1],
  y = um$layout[, 2],
  label = labels
)

ggplot(umap_df, aes(x, y, color = label)) +
  geom_point(alpha = 0.7) +
  theme_minimal() +
  labs(title = "UMAP Projection")
```

## Parameter Tuning

```r
# n_neighbors: larger = more global structure
# min_dist: smaller = tighter clusters

# Try different parameters
params <- expand.grid(
  n_neighbors = c(5, 15, 50),
  min_dist = c(0.01, 0.1, 0.5)
)
```

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…