Loads a saved glow_B_model object and optionally validates its structure, including checking the metadata envelope and testing prediction capability.

load_B_model(path, validate = TRUE)

Arguments

path

Character. Path to a saved B model (.rds file).

validate

Logical (default TRUE). Check object structure on load.

Value

A glow_B_model object. Use predict_B to apply it to new MAF values.

Details

The validation checks the envelope's fields, the model's class, the presence of a fitted model and a test prediction, and compares the envelope's format_version with the serialization format this version of the package reads (format 1). A file whose stamp differs, is absent or is not a single number is still loaded, with a warning that asks the user to verify its predictions. The version of GLOWr that saved the model is recorded in the envelope's metadata as provenance and is not compared, so a model saved by an earlier version loads without a warning as long as the format is the same.

See also

save_B_model for saving models predict_B for applying loaded models to new data train_B_model for training B estimation models

Examples

if (FALSE) { # \dontrun{
B_model <- load_B_model("B_model_als.rds")
B_values <- predict_B(B_model, target_MAF = c(0.01, 0.05, 0.1))
} # }