Skip to contents

Prints a formatted evaluation table including per-trait metrics, gate calibration, and conformal coverage. For a trait represented by multiple latent columns, the displayed gate uses its first latent column. Requires the original pigauto_data object to compute test-set performance.

Usage

# S3 method for class 'pigauto_fit'
summary(object, ..., data = NULL)

Arguments

object

pigauto_fit object.

...

ignored.

data

pigauto_data object used for fitting (optional; when NULL the summary skips per-trait test metrics).

Value

Invisibly returns the evaluation data.frame, or NULL if data is not supplied, the fit has no test cells, or evaluation fails. If evaluation fails, the method prints a message and returns NULL.

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
pd <- preprocess_traits(traits, tree)
splits <- make_missing_splits(pd$X_scaled, trait_map = pd$trait_map)
fit <- fit_pigauto(pd, tree, splits = splits, epochs = 5L,
                   verbose = FALSE)
#> Warning: Small validation set for 2 trait(s): Mass (n=2), Wing.Length (n=1). Calibrated gate and conformal scores will be noisy for these trait(s). 95% split-conformal coverage is NOT achievable for 2 trait(s) with fewer than 19 validation cells (Mass (n=2), Wing.Length (n=1)): the achievable ceiling is n_val / (n_val + 1), which only reaches 0.95 at n_val >= 19. See `?fit_pigauto` under 'Calibration at small n' for smoothing options.
# This small test set illustrates the output; it is too small for a
# stable performance conclusion. Use a held-out design sized for your
# question. Repeated splits or seeds assess split/training variability,
# but do not by themselves establish generalisation.
summary(fit, data = pd)
#> pigauto_fit summary
#> -------------------------------------------------------- 
#> Species: 30 | Traits: 2 | Epochs: 0
#> GNN: off (baseline only)
#> Trait types:  continuous=2 
#> 
#> Best validation loss: 0.1865
#> Test loss:            0.1262
#> 
#> Trait Performance (test set):
#> -------------------------------------------------------- 
#>   Trait                     Type               n     RMSE        r      MAE 
#>   -------------------------------------------------------------------------
#>   Mass                      continuous         5    0.072    0.998    0.050 
#>   Wing.Length               continuous         7    0.154    0.964    0.142 
#> 
#>   Baseline (BM) for comparison:
#>   -------------------------------------------------------------------------
#>   Mass                      continuous         5    0.072    0.998    0.050 
#>   Wing.Length               continuous         7    0.154    0.964    0.142 
#> 
#> Gate Calibration:
#>    Mass: 0.000  Wing.Length: 0.000 
#> 
#> Conformal Scores (latent scale, 95% nominal):
#>    Mass: 0.3205  Wing.Length: 0.0099 
#> Conformal Coverage (test set):
#>    Mass: 100.0%  Wing.Length: 0.0% 
#> 
# }