Removes large n x n (or n x m) intermediates from a fitted
krls_rr object so it serialises (saveRDS) much smaller.
Two modes:
Arguments
- fit
A
krls_rrfit.- keep_predict
Logical. If
TRUE(default), keep enough state forpredict()to run.
Details
keep_predict = TRUE(default): keeps everythingpredict.krls_rr()needs (coeffs, sigma / sigma_vec, lambda, the standardisation stats, factor bookkeeping, and Nystrom landmarks where applicable). Drops theK, eigenvector matricesV/Vsq, projected responseVty, andvcov.c.keep_predict = FALSE: keeps only inspection-grade summary fields (coeffs,R2,Looe,avgderivatives,var.avgderivatives,sigma,sigma_vec,lambda,Neffective).predict()will refuse to run.
The returned object carries the flag $slimmed = TRUE.
unslim_krls() is a no-op (heavy intermediates can only be
rebuilt by refitting).