Skip to contents

Takes a data.frame of benchmark results and produces a forest-plot style figure comparing baseline and GNN performance per trait. Each trait appears on the y-axis; points mark RMSE (continuous/count) or accuracy (binary/categorical) for the two methods, connected by a horizontal line colour-coded by whether the GNN improves over the baseline.

Usage

plot_comparison(
  results,
  metric = NULL,
  methods = c("baseline", "pigauto"),
  ...
)

Arguments

results

A data.frame with columns trait, type, metric, method, and value. Typically the output of compare_methods, evaluate, or reshaped output from evaluate_imputation.

metric

Character. Which metric to compare. Default NULL auto-selects: "rmse" for continuous/count traits and "accuracy" for binary/categorical traits. If a single metric name is supplied, only traits with that metric are shown.

methods

Character vector of length 2: the baseline method name and the pigauto method name. Default c("baseline", "pigauto"), matching the labels returned by compare_methods and evaluate.

...

Additional arguments passed to plot().

Value

Invisible NULL. Called for its side effect (plotting).

Details

When both RMSE and accuracy metrics are present and metric is NULL, a two-panel figure is produced automatically.

Examples

# \donttest{
results <- data.frame(
  trait = rep("Mass", 2L), type = rep("continuous", 2L),
  metric = rep("rmse", 2L), method = c("baseline", "pigauto"),
  value = c(1, 0.8)
)
plot_comparison(results)

plot_comparison(results, metric = "rmse")
# }