Applies all models in the ensemble to new annotation data and computes both per-model predictions and ensemble-averaged PI values.
predict_PI_ensemble(
models,
newdata,
model_type = "auto",
na_impute = TRUE,
reference_medians = NULL
)List of model objects, or output from load_PI_models().
Matrix or data.frame of annotations (N variants x M features). Column names should match the features used in model training.
Character. "auto" (detect), "LASSO", or "GLM".
Logical. If TRUE, impute NA values before prediction. Default: TRUE.
Named numeric vector of reference medians for NA
imputation (optional). Typically from compute_annotation_medians().
When provided, NAs are imputed with these chromosome-wide medians instead
of per-gene column medians. Names must match column names in newdata.
List with components:
Matrix (N x n_models) of per-model predictions
Numeric vector (N) of averaged predictions
Number of models used
Logical, whether imputation was applied
if (FALSE) { # \dontrun{
models <- load_PI_models("path/to/piModels/")
new_annot <- read.csv("new_variants_annotated.csv")
pred <- predict_PI_ensemble(models, new_annot)
hist(pred$ensemble_pi)
} # }