Apply MAD-scaled SVD residual filter to new samples
Source:R/singlesample-batch-correction.R
apply_robust_pca_residual.RdProjects test samples into the frozen PC space estimated by
fit_robust_pca_residual, then returns the residual (test
sample minus reconstruction from top-n_components PCs) as a
low-rank-removed representation.
All training features must be present in x_test.
Arguments
- fit
A
robust_pca_residual_fitobject fromfit_robust_pca_residual.- x_test
Numeric matrix (samples \(\times\) features). All values must be non-negative.
- return_reconstructed
Logical. If
TRUE, returns a list with componentsscores,reconstructed, andresidual. IfFALSE(default), returns only the residual matrix.