View source: R/calculatePvalues.R
calculate_quantiles | R Documentation |
This function computes the mean, lower, and upper quantiles of permuted feature importance scores and compares them with the observed importance scores from the true values. It is used to assess the significance of feature importances from random forest models by comparing them against a distribution of importances obtained through permutation.
calculate_quantiles(truevalues, permutedvalues, alpha = 0.05)
truevalues |
A data frame containing true feature importance data.
It should have columns: feature_rank, feature_importance, and log_feature_importance.
This is typically obtained from the |
permutedvalues |
A data frame containing permuted feature importance data.
It should have the same structure as |
alpha |
Numeric value representing the significance level used to calculate the upper and lower quantiles of the permuted importances. It must be between 0 and 1, exclusive. Default is 0.05. |
A tibble/data frame with columns for feature rank, mean permuted importance, lower and upper quantile bounds, observed true importance, and their respective logarithmic transformations. This data frame provides a comprehensive view of where true importances lie in relation to the distribution of permuted importances.
quantile_results <- calculate_quantiles(feat_importances$true_importances, feat_importances$permuted_importances, alpha=0.05)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.