mrVipPCA | R Documentation |
Principal Component Analysis of mrIML variable importance
mrVipPCA(mrVip_obj)
mrVip_obj |
A list returned by |
A list of PCA results:
$PCA_plot
: Side-by-side plots of the different response
models on the first two principal components (PCs) and a
Scree plot.
$PC_outliers
: A list of the models flagged as outliers
on at least one of the PCs.
$eigenvalues
: The eigenvalues associated with the
principal components.
$PC_scores
: The PC scores of each response model.
library(tidymodels)
# Without bootstrap
data <- MRFcov::Bird.parasites
Y <- data %>%
select(-scale.prop.zos) %>%
select(order(everything()))
X <- data %>%
select(scale.prop.zos)
model_rf <- rand_forest(
trees = 50, # 50 trees are set for brevity. Aim to start with 1000
mode = "classification",
mtry = tune(),
min_n = tune()
) %>%
set_engine("randomForest")
mrIML_rf <- mrIMLpredicts(
X = X,
Y = Y,
X1 = Y,
Model = model_rf,
prop = 0.7,
k = 2,
racing = FALSE
)
mrIML_rf_vip <- mrVip(mrIML_rf, taxa = "Plas")
mrIML_rf_vip %>%
mrVipPCA()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.