This function plots the SHAP feature importance results of user-selected sample.
Usage
plot_shap_sample(shap_se, sample_id = 10)
Arguments
- shap_se
A SummarizedExperiment object with results computed by ml_shap
.
- sample_id
Numeric. The number of samples to display for each feature. Default is 10
.
Value
Return 1 interactive plot, 1 static plot, and 1 table.
interactive_sample_feature_importance & static_sample_feature_importance:
SHAP feature importance plot.
table_sample_feature_importance: table for plotting SHAP feature importance.
Examples
data("ml_se_sub")
shap_se <- ml_shap(ml_se_sub, feature_num=10, nsim=5)
sample_id_list <- unique(S4Vectors::metadata(shap_se)$shap_result$ID)
res <- plot_shap_sample(shap_se, sample_id=sample_id_list[10])