بنقرة واحدة
vip
R vip package for variable importance. Use for computing and visualizing variable importance scores.
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
R vip package for variable importance. Use for computing and visualizing variable importance scores.
التثبيت باستخدام 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 machine learning packages. Use for classification, regression, clustering, deep learning, gradient boosting (xgboost, lightgbm), random forests, neural networks, and time series forecasting.
| name | vip |
| description | R vip package for variable importance. Use for computing and visualizing variable importance scores. |
Variable Importance Plots.
library(vip)
# Variable importance plot
vip(model)
# With options
vip(model, num_features = 10)
# Model-specific (default)
vip(model, method = "model")
# Permutation-based
vip(model, method = "permute",
train = train_data,
target = "y",
metric = "rmse")
# SHAP-based
vip(model, method = "shap",
train = train_data)
# FIRM (feature importance ranking measure)
vip(model, method = "firm",
train = train_data)
# Permutation importance
vi_perm <- vi_permute(
model,
train = train_data,
target = "y",
metric = "rmse",
nsim = 10
)
# Plot
vip(vi_perm)
# SHAP-based importance
vi_shap <- vi_shap(
model,
train = train_data
)
vip(vi_shap)
# Custom loss function
my_metric <- function(actual, predicted) {
mean(abs(actual - predicted))
}
vi_permute(model, train = train_data, target = "y",
metric = my_metric)
# Partial dependence plots
library(pdp)
# Single variable
partial(model, pred.var = "age", train = train_data) %>%
autoplot()
# Two variables
partial(model, pred.var = c("age", "income"), train = train_data) %>%
autoplot()
# Get importance values
vi(model)
# As data frame
vi_model(model)
# Sorted
vi(model) %>%
arrange(desc(Importance))
vip(model,
num_features = 10,
geom = "point", # or "col", "boxplot"
aesthetics = list(
color = "steelblue",
fill = "steelblue"
))
# Horizontal
vip(model, horizontal = TRUE)
# Include zero
vip(model, include_type = TRUE)
# Compare models
vi1 <- vi(model1)
vi2 <- vi(model2)
# Combine and plot
library(ggplot2)
bind_rows(
mutate(vi1, model = "Model 1"),
mutate(vi2, model = "Model 2")
) %>%
ggplot(aes(x = reorder(Variable, Importance), y = Importance, fill = model)) +
geom_col(position = "dodge") +
coord_flip()