Skip to contents

Two views of the passing sets, one panel per set size:

Usage

plot_variable_sets(
  x,
  x_metric = NULL,
  y_metric = NULL,
  n_labels = 5,
  base_size = 10,
  type = c("scores", "scatter"),
  n = 8,
  sizes = NULL,
  file = NULL,
  width = 3000,
  height = NULL
)

Arguments

x

A var_selection.

x_metric, y_metric

Scores on the axes of the scatter (default: the two criteria with the most distinct values). Giving one switches to the scatter.

n_labels

Number of best-ranked sets labelled per size in the scatter.

base_size

Base font size.

type

"scores" or "scatter".

n

Number of best-ranked sets per size in the score card, or "all" (also Inf) for every passing set.

sizes

Optional set sizes to show, e.g. 2:3; default all sizes that were searched.

file

Optional file(s) to save the plot to, e.g. "sets.pdf" or c("sets.png", "sets.pdf"); the format follows the extension, and a name without extension is saved as PNG and PDF. The height grows with the number of rows. The plot is also returned.

width, height

Size of the saved figure in pixels (height default: from the number of rows; PDF and SVG at 300 pixels per inch).

Value

A ggplot object (invisibly when file is given).

Details

  • type = "scores" (default): a score card. Rows are the best-ranked sets, columns the criteria and the largest correlations; each cell shows the value, shaded by how good it is among all passing sets of that size: darker = better, which is the lowest value in columns marked "lower is better" (e.g. novelty, VIF, correlations) and the highest in columns marked "higher is better". Sets on the Pareto front are marked *.

  • type = "scatter": every passing set in the space of two criteria. Pareto-front sets are filled blue, and the best-ranked sets carry their rank, with the key below the plot. Scores that take few distinct values (e.g. gradient_min, which is decided by one variable) put the sets on lines; choose other axes with x_metric and y_metric, or use the score card.

Examples

# see ?select_variables; e.g.
# plot_variable_sets(vs)                          # 8 best sets per size
# plot_variable_sets(vs, sizes = 2:3, n = 4)      # sizes 2 and 3, 4 each
# plot_variable_sets(vs, sizes = 3, n = "all")    # every passing 3-set
# plot_variable_sets(vs, file = "variable_sets.pdf")
# plot_variable_sets(vs, type = "scatter")