Skip to contents

S3 plot method for pigauto_fit objects, using base R graphics. Three plot types are available: training history, calibrated gate values, and conformal prediction scores.

Usage

# S3 method for class 'pigauto_fit'
plot(x, type = "history", ...)

Arguments

x

An object of class "pigauto_fit".

type

Character. "history" (default): 2x2 panel of training loss components (reconstruction, shrinkage, gate regularisation) and validation loss over epochs. "gates": bar plot of calibrated gate values per trait, coloured by trait type (green = continuous, blue = count, orange = ordinal, red = binary, purple = categorical). "conformal": bar plot of conformal prediction scores per trait with a reference line at the median score.

...

Additional arguments passed to base plotting functions.

Value

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

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
data <- preprocess_traits(traits, tree)
splits <- make_missing_splits(data$X_scaled, trait_map = data$trait_map)
fit <- fit_pigauto(data, tree, splits = splits, epochs = 5L,
                   eval_every = 1L, verbose = FALSE)
#> Error: Lantern is not loaded. Please use `install_torch()` to install additional dependencies.
plot(fit)
#> Error: object 'fit' not found
plot(fit, type = "history")
#> Error: object 'fit' not found
plot(fit, type = "gates")
#> Error: object 'fit' not found
plot(fit, type = "conformal")
#> Error: object 'fit' not found
# }