pareto_plot: Pairwise plots for visual Pareto based multi-objective...

View source: R/utility_functions.R

pareto_plotR Documentation

Pairwise plots for visual Pareto based multi-objective optimization

Description

Plots the given data with pairwise scatter plots for each pair of given columns. Intended to be used with scoring output.

Usage

pareto_plot(
  scores,
  plot_palette = pals::watlington(16),
  metrics = c("TrainStabilityJaccard", "Silhouette", "Smallest_cluster_size"),
  metrics_scale = rep("identity", length(metrics)),
  color_var = Transform,
  shape_var = Clustering,
  size_var = k,
  size_range = c(2, 6),
  size_guide = ggplot2::guide_legend(ncol = 1, order = 3),
  color_scale = ggplot2::scale_color_manual(values = plot_palette),
  color_guide = ggplot2::guide_legend(ncol = 1, order = 1),
  shape_scale = ggplot2::scale_shape_manual(values = 0:14),
  shape_guide = ggplot2::guide_legend(ncol = 1, order = 2),
  plot_pareto_front = FALSE,
  front_color = "black",
  metric_comparators = if (plot_pareto_front) get_metric_comparators(metrics) else NULL,
  point_args = list()
)

Arguments

scores

data.frame of scores

plot_palette

color codes used for coloring based on color_var

metrics

column names in scores to plot

metrics_scale

either "identity" or "nlog10" where the latter is meant for translating p-values to negative log10

color_var

column name in scores for color

shape_var

column name in scores for shape

size_var

column name in scores for size

size_range

controls the range of point sizes

size_guide

can be used to adjust the size legend

color_scale

can be used instead of plot_palette to control colors

color_guide

can be used to adjust the color legend (see guide_legend or guide_colourbar)

shape_scale

can be used to control point shapes

shape_guide

can be used to control the shape legend

plot_pareto_front

If TRUE, plots a step-function showing the first Pareto front for each pair of metrics.

front_color

color of pairwise Pareto front step-function.

metric_comparators

Required if plot_pareto_front==TRUE, see details below.

point_args

list of additional arguments passed to geom_point

Details

For Pareto fronts metric_comparators should be a list of .Primitive(">") and .Primitive("<"). ">" should be used for metrics that should be maximized and "<" for metrics that should minimized. By default they are guessed by get_metric_comparators, but for plots involving variable associations and p-values they should be set manually.

Value

grid.arrange result


vittoriofortino84/COPS documentation built on Jan. 28, 2025, 3:16 p.m.