بنقرة واحدة
dbscan
R dbscan package for density-based clustering. Use for DBSCAN, OPTICS, and HDBSCAN clustering.
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
R dbscan package for density-based clustering. Use for DBSCAN, OPTICS, and HDBSCAN clustering.
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
R language data analysis and visualization skill. Use when user asks to (1) run R scripts or code, (2) install/update R packages, (3) perform data analysis with R, (4) create visualizations with ggplot2/plotly, (5) statistical analysis, (6) data manipulation with tidyverse/dplyr/data.table. Triggers on keywords like "R语言", "R脚本", "ggplot", "tidyverse", "数据分析", "可视化".
R DALEX package for model explanations. Use for explaining complex machine learning models.
R iml package for interpretable ML. Use for model-agnostic interpretability methods.
R lime package for local explanations. Use for explaining individual predictions with local interpretable models.
R packages for ML interpretability. Use for explaining and interpreting machine learning models.
R vip package for variable importance. Use for computing and visualizing variable importance scores.
| name | dbscan |
| description | R dbscan package for density-based clustering. Use for DBSCAN, OPTICS, and HDBSCAN clustering. |
Density-based clustering algorithms.
library(dbscan)
# DBSCAN clustering
db <- dbscan(data, eps = 0.5, minPts = 5)
# Results
db$cluster # 0 = noise
db$eps
db$minPts
# Plot
plot(data, col = db$cluster + 1L)
hullplot(data, db)
# k-nearest neighbor distances
kNNdist(data, k = 5)
# Plot to find elbow
kNNdistplot(data, k = 5)
abline(h = 0.5, col = "red")
# OPTICS ordering
opt <- optics(data, eps = 10, minPts = 5)
# Reachability plot
plot(opt)
# Extract clusters
db <- extractDBSCAN(opt, eps_cl = 0.5)
db <- extractXi(opt, xi = 0.05)
# Plot
hullplot(data, db)
# Hierarchical DBSCAN
hdb <- hdbscan(data, minPts = 5)
# Results
hdb$cluster
hdb$membership_prob
hdb$outlier_scores
# Plot
plot(hdb)
plot(hdb, show_flat = TRUE)
# Compute LOF scores
lof_scores <- lof(data, minPts = 5)
# Higher scores = more outlier-like
plot(data, cex = lof_scores)
# k-nearest neighbors
nn <- kNN(data, k = 5)
# Results
nn$id # Neighbor indices
nn$dist # Distances
# Shared nearest neighbors
snn <- sNN(data, k = 5)
# Points in eps-neighborhood
frNN(data, eps = 0.5)
# Predict cluster for new points
predict(db, newdata = new_data, data = data)
# Use index for speed
db <- dbscan(data, eps = 0.5, minPts = 5,
search = "kdtree") # or "linear", "dist"