بنقرة واحدة
rtsne
R Rtsne package for t-SNE. Use for t-distributed stochastic neighbor embedding visualization.
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
R Rtsne package for t-SNE. Use for t-distributed stochastic neighbor embedding visualization.
التثبيت باستخدام 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 | Rtsne |
| description | R Rtsne package for t-SNE. Use for t-distributed stochastic neighbor embedding visualization. |
t-Distributed Stochastic Neighbor Embedding.
library(Rtsne)
# Run t-SNE
tsne <- Rtsne(data, dims = 2, perplexity = 30)
# Results
tsne$Y # 2D coordinates
# Plot
plot(tsne$Y, col = labels, pch = 19)
tsne <- Rtsne(data,
dims = 2, # Output dimensions
perplexity = 30, # Perplexity (5-50)
theta = 0.5, # Speed/accuracy trade-off (0 = exact)
max_iter = 1000, # Iterations
eta = 200, # Learning rate
pca = TRUE, # Initial PCA
pca_center = TRUE,
pca_scale = FALSE,
verbose = TRUE
)
# t-SNE requires unique rows
tsne <- Rtsne(unique(data), check_duplicates = FALSE)
# Or
tsne <- Rtsne(data, check_duplicates = TRUE) # Default
# Compute distances
d <- dist(data)
# t-SNE from distances
tsne <- Rtsne(as.matrix(d), is_distance = TRUE)
# Set seed for reproducibility
set.seed(42)
tsne <- Rtsne(data)
# Or use seed parameter
tsne <- Rtsne(data, seed = 42)
# Try different perplexities
perplexities <- c(5, 10, 30, 50)
par(mfrow = c(2, 2))
for (p in perplexities) {
tsne <- Rtsne(data, perplexity = p)
plot(tsne$Y, main = paste("Perplexity:", p))
}
library(ggplot2)
tsne_df <- data.frame(
x = tsne$Y[, 1],
y = tsne$Y[, 2],
label = labels
)
ggplot(tsne_df, aes(x, y, color = label)) +
geom_point() +
theme_minimal()
# Use Barnes-Hut approximation
tsne <- Rtsne(data, theta = 0.5) # Faster
# Exact t-SNE (slow)
tsne <- Rtsne(data, theta = 0)