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("BM_baseline", "pigauto_GNN"),
  ...
)

Arguments

results

A data.frame with columns trait, type, metric, method, and value. Typically the output of benchmark scripts 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 GNN method name. Default c("BM_baseline", "pigauto_GNN").

...

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

if (FALSE) { # \dontrun{
results <- read.csv("benchmark_results.csv")
plot_comparison(results)
plot_comparison(results, metric = "rmse")
} # }