Apply frozen logistic-normal EB shrinkage to new samples
Source:R/singlesample-additional-within-sample.R
apply_logistic_normal_eb.RdShrinks CLR-transformed test samples toward the per-feature training prior
using the model fitted by fit_logistic_normal_eb.
Missing test features are handled by missing_features:
"error" (default, fail-closed) or "fill_with_prior" (pads
missing features with NA in the test matrix, then the posterior
collapses fully to the prior mean for those features).
Usage
apply_logistic_normal_eb(
fit,
x_test,
missing_features = c("error", "fill_with_prior")
)Arguments
- fit
A
logistic_normal_eb_fitobject fromfit_logistic_normal_eb.- x_test
Numeric matrix (samples \(\times\) features). All values must be non-negative.
- missing_features
"error"(default) or"fill_with_prior".