Runs a full comparison of the BM baseline and pigauto (with attention + calibration) over multiple random seeds. Returns a tidy data.frame suitable for plotting or downstream analysis.
Usage
compare_methods(
data,
tree,
splits = NULL,
seeds = NULL,
epochs = 500L,
verbose = TRUE,
...
)Arguments
- data
pigauto_data object.
- tree
phylo object.
- splits
pre-computed splits (applied to all reps) or
NULLto create fresh splits per seed.- seeds
optional integer vector of random seeds for replication. The default
NULLperforms one run using the current RNG stream.- epochs
number of training epochs.
- verbose
logical.
- ...
additional arguments passed to
fit_pigauto.
Details
For each seed the function:
Creates train/val/test splits.
Fits the phylogenetic BM baseline.
Fits pigauto (with attention and calibration enabled by default).
Evaluates both methods on the test split.
Collects results into a single data.frame.
Examples
# \donttest{
data(avonet300, tree300)
tree <- ape::keep.tip(tree300, tree300$tip.label[seq_len(30L)])
traits <- avonet300[match(tree$tip.label, avonet300$Species_Key),
c("Mass", "Wing.Length"), drop = FALSE]
rownames(traits) <- tree$tip.label
cmp <- compare_methods(preprocess_traits(traits, tree), tree, seeds = 1L,
epochs = 5L, verbose = FALSE)
#> Error: Lantern is not loaded. Please use `install_torch()` to install additional dependencies.
aggregate(value ~ method + trait + metric, data = cmp, FUN = mean)
#> Error in eval(m$data, parent.frame()): object 'cmp' not found
# }
