Learn R Programming

dtGAP (version 0.0.2)

prediction_annotation: Annotate Predsictions Information

Description

Creates row annotations showing predicted vs true class labels and probabilities, with optional data_type coloring.

Usage

prediction_annotation(
  sorted_dat,
  target_lab,
  task = c("classification", "regression"),
  label_map = NULL,
  label_map_colors = NULL,
  type_palette = "Dark2",
  label_palette = "OrRd",
  n_label_color = 9,
  prop_palette = gray,
  n_prop_colors = 11,
  gap_mm = unit(1, "mm")
)

Value

A rowAnnotation object for predictions and truth.

Arguments

sorted_dat

List from sorted_mat(), containing dat_sorted with predictions.

target_lab

Name of true label column in dat_sorted.

task

Character. Type of task: "classification" or "regression".

label_map

Optional named vector to map raw labels to new labels.

label_map_colors

Optional named vector of colors for mapped labels.

type_palette

RColorBrewer palette for data_type (default "Dark2").

label_palette

Function or vector of colors for true and predicted value (default OrRd).

n_label_color

Number of colors for probability palette (default 9).

prop_palette

Function or vector of colors for probability gradient (default gray).

n_prop_colors

Number of colors for probability palette (default 11).

gap_mm

Unit for gap between annotations (default unit(1, "mm") ).