R/visualization.R
plot_pareto_evolution.RdTwo-panel animated GIF showing how the rank-1 (Pareto) population evolves across NSGA generations: the left panel plots the Pareto front in objective space, the right panel plots inclusion frequency of base features in that generation's Pareto solutions. Both axes (Pareto-panel x/y, frequency-panel features) are held fixed across frames so the animation is comparable frame-to-frame.
plot_pareto_evolution(
optimization_result,
x_metric = "sensitivity",
y_metric = "specificity",
top_n_features = 15L,
generations = NULL,
fps = 4,
width = 1000,
height = 500,
point_size = 3,
viridis_option = "plasma",
path = NULL
)An OptimizationResult from optimize_panel().
Objective names for the Pareto panel axes.
Defaults "sensitivity" / "specificity".
Integer; number of features to display on the
right panel. Default 15.
One of: NULL (all recorded generations, default), a
single integer n giving the number of evenly-spaced frames to render,
or an integer vector of specific generation numbers.
Numeric; animation frames per second. Default 4.
Frame dimensions in pixels. Default 1000 x 500.
Point size in the Pareto panel. Default 3.
Viridis palette for coloring by panel size. Default
"plasma".
Optional file path to write the GIF to. Default NULL
(in-memory only).
A magick-image representing the animated GIF.
Requires the optimization to have been run with record_history = TRUE.
The set of features shown on the right panel is the top-N base features
by total appearances across the rank-1 population of all recorded
generations; features not present in a given generation drop to zero.
if (FALSE) { # \dontrun{
opt <- optimize_panel(x, y, record_history = TRUE)
anim <- plot_pareto_evolution(opt)
anim # display in RStudio viewer
plot_pareto_evolution(opt, path = "evolution.gif")
} # }