View source: R/evaluator-lib-inference.R
eval_reject_prob | R Documentation |
Evaluate the probability of rejecting the null hypothesis across various levels of significance (possibly for multiple hypothesis tests, one for each feature).
eval_reject_prob(
fit_results,
vary_params = NULL,
nested_cols = NULL,
feature_col = NULL,
pval_col,
group_cols = NULL,
alphas = NULL,
na_rm = FALSE
)
fit_results |
A tibble, as returned by |
vary_params |
A vector of |
nested_cols |
(Optional) A character string or vector specifying the
name of the column(s) in |
feature_col |
A character string identifying the column in
|
pval_col |
A character string identifying the column in
|
group_cols |
(Optional) A character string or vector specifying the column(s) to group rows by before evaluating metrics. This is useful for assessing within-group metrics. |
alphas |
(Optional) Vector of significance levels at which to evaluate
the rejection probability. By default, |
na_rm |
A |
A grouped tibble
containing both identifying information
and the rejection probability results aggregated over experimental
replicates. Specifically, the identifier columns include .dgp_name
,
.method_name
, any columns specified by group_cols
and
vary_params
, and the feature names given in feature_col
if
applicable. In addition, there are results columns .alpha
and
reject_prob
, which respectively give the significance level and the
estimated rejection probabilities (averaged across experimental
replicates).
Other inference_funs:
eval_testing_curve_funs
,
eval_testing_err_funs
,
plot_reject_prob()
,
plot_testing_curve()
,
plot_testing_err()
# generate example fit_results data for a feature selection problem
fit_results <- tibble::tibble(
.rep = rep(1:2, times = 2),
.dgp_name = c("DGP1", "DGP1", "DGP2", "DGP2"),
.method_name = c("Method"),
feature_info = lapply(
1:4,
FUN = function(i) {
tibble::tibble(
# feature names
feature = c("featureA", "featureB", "featureC"),
# true feature support
true_support = c(TRUE, FALSE, TRUE),
# estimated p-values
pval = 10^(sample(-3:0, 3, replace = TRUE))
)
}
)
)
# evaluate rejection probabilities for each feature across all possible values of alpha
eval_results <- eval_reject_prob(
fit_results,
nested_cols = "feature_info",
feature_col = "feature",
pval_col = "pval"
)
# evaluate rejection probability for each feature at specific values of alpha
eval_results <- eval_reject_prob(
fit_results,
nested_cols = "feature_info",
feature_col = "feature",
pval_col = "pval",
alphas = c(0.05, 0.1)
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.