Fits and evaluates every Pareto-optimal solution from optimize_panel() on
held-out validation data and displays the trade-off between two metrics as a
scatter plot. The underlying data frame is accessible via $data on the
returned ggplot object.
plot_pareto_front(
optimization_result,
x = NULL,
y = NULL,
cohort = NULL,
objectives = NULL,
x_metric = "sensitivity",
y_metric = "specificity",
color_by = "n_features",
point_size = 4,
point_alpha = 0.7,
viridis_option = "plasma",
title = NULL,
xlab = NULL,
ylab = NULL,
color_label = NULL,
connect = FALSE,
on_error = c("warn", "stop"),
regularized = TRUE,
verbose = interactive()
)An OptimizationResult from optimize_panel().
Held-out validation data: a matrix, data.frame,
SummarizedExperiment, or list of such objects. When NULL (default),
automatically uses held-out data stored on optimization_result by
optimize_panel() (present when train_ratio + val_ratio < 1).
Held-out validation labels: a factor (or list of factors when x
is a list). When NULL (default), automatically uses held-out labels
stored the same way.
Optional cohort factor for single-matrix x; passed to
evaluate_pareto_solutions().
Optional objective override; passed to
evaluate_pareto_solutions().
Character; column name for the x-axis. Any column of
evaluate_pareto_solutions() output, i.e. "sensitivity",
"specificity", "auc", "n_features", "n_base_features", or an
obj_-prefixed optimisation objective such as "obj_auc". Default
"sensitivity".
Character; column name for the y-axis. Same options as
x_metric. Default "specificity".
Column name to map to point colour (e.g. "n_features",
"auc", an obj_ column), or NULL to disable. Default
"n_features".
Numeric; point size. Default 4.
Numeric; point transparency. Default 0.7.
Character; viridis palette name. Default "plasma".
Character or NULL; plot title. Auto-generated when NULL.
Character or NULL; x-axis label. Defaults to x_metric.
Character or NULL; y-axis label. Defaults to y_metric.
Character or NULL; color legend label. Defaults to
color_by.
Logical; if TRUE, connect points with a line sorted by the
x-axis metric. Default FALSE.
One of "warn" or "stop". Controls behaviour when a
solution fails evaluation. "warn" (default) skips the solution with a
warning; "stop" raises an error immediately.
Logical; passed to fit_panel(). Default TRUE.
Logical; print progress messages. Default interactive().
A ggplot object. The underlying metrics data frame is accessible
via $data.
if (FALSE) { # \dontrun{
opt <- optimize_panel(x_train, y_train, objectives = define_objectives())
p <- plot_pareto_front(opt, x_test, y_test)
p # display plot
p$data # access metrics data.frame
} # }