ワンクリックで
irlba
R irlba package for fast SVD/PCA. Use for truncated SVD and PCA on large matrices.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
R irlba package for fast SVD/PCA. Use for truncated SVD and PCA on large matrices.
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 | irlba |
| description | R irlba package for fast SVD/PCA. Use for truncated SVD and PCA on large matrices. |
Fast truncated SVD and PCA.
library(irlba)
# Compute top 5 singular vectors
svd_result <- irlba(A, nv = 5)
# Results
svd_result$u # Left singular vectors
svd_result$v # Right singular vectors
svd_result$d # Singular values
# PCA via SVD
pca <- prcomp_irlba(data, n = 5)
# Results
pca$x # Scores (rotated data)
pca$rotation # Loadings
pca$sdev # Standard deviations
pca$center # Means
pca$scale # Scales
# Predict
predict(pca, newdata = new_data)
# With centering and scaling
pca <- prcomp_irlba(data, n = 5,
center = TRUE,
scale. = TRUE)
# More iterations for accuracy
svd_result <- irlba(A, nv = 5, maxit = 1000)
library(Matrix)
# Create sparse matrix
sparse_A <- Matrix(A, sparse = TRUE)
# SVD on sparse matrix
svd_result <- irlba(sparse_A, nv = 5)
# Only left vectors
svd_result <- irlba(A, nv = 5, nu = 0)
# Only right vectors
svd_result <- irlba(A, nv = 5, nv = 0)
# For better convergence
svd_result <- irlba(A, nv = 5,
work = 20, # Working subspace size
reorth = TRUE) # Reorthogonalization
# Base R (computes all)
svd_full <- svd(A)
# irlba (computes only top k)
svd_partial <- irlba(A, nv = 5)
# Much faster for large matrices
# Reconstruct matrix
svd_result <- irlba(A, nv = 5)
A_approx <- svd_result$u %*% diag(svd_result$d) %*% t(svd_result$v)