View source: R/visualizer-lib-inference.R
plot_reject_prob | R Documentation |
Plot the probability of rejecting the null hypothesis across various levels of significance.
plot_reject_prob(
fit_results = NULL,
eval_results = NULL,
eval_name = NULL,
eval_fun = "eval_reject_prob",
eval_fun_options = NULL,
vary_params = NULL,
feature_col = NULL,
show_features = NULL,
show_identity_line = FALSE,
show = c("line"),
...
)
fit_results |
A tibble, as returned by |
eval_results |
A list of result tibbles, as returned by
|
eval_name |
Name of |
eval_fun |
Character string, specifying the function used to compute
the data used for plotting if |
eval_fun_options |
List of named arguments to pass to |
vary_params |
A vector of |
feature_col |
A character string identifying the column in
|
show_features |
Vector of feature names corresponding to features to
display in the plot. If |
show_identity_line |
Logical indicating whether or not to plot the y = x line. |
show |
Character vector with elements being one of "boxplot", "point", "line", "bar", "errorbar", "ribbon", "violin", indicating what plot layer(s) to construct. |
... |
Arguments passed on to
|
If interactive = TRUE
, returns a plotly
object if
plot_by
is NULL
and a list of plotly
objects if
plot_by
is not NULL
. If interactive = FALSE
, returns
a ggplot
object if plot_by
is NULL
and a list of
ggplot
objects if plot_by
is not NULL
.
Other inference_funs:
eval_reject_prob()
,
eval_testing_curve_funs
,
eval_testing_err_funs
,
plot_testing_curve()
,
plot_testing_err()
# generate example fit_results data
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"),
# estimated p-values
pval = 10^(sample(-3:0, 3, replace = TRUE))
)
}
)
)
# generate example eval_results data
eval_results <- list(
`Reject Prob.` = eval_reject_prob(
fit_results,
nested_cols = "feature_info",
feature_col = "feature",
pval_col = "pval"
)
)
# create bar plot using pre-computed evaluation results
plt <- plot_reject_prob(eval_results = eval_results,
eval_name = "Reject Prob.",
feature_col = "feature")
# or alternatively, create the same plot directly from fit results
plt <- plot_reject_prob(fit_results = fit_results,
feature_col = "feature",
eval_fun_options = list(
nested_cols = "feature_info",
pval_col = "pval"
))
# can customize plot (see plot_eval_constructor() for possible arguments)
plt <- plot_reject_prob(eval_results = eval_results,
eval_name = "Reject Prob.",
facet_formula = NULL,
plot_by = "feature")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.