This is extension of the suggestion by Frank in the comments. Dr. Harrel please correct if I am wrong (appreciate corrections).
require(rms)
ols
function is used for Linear Model Estimation Using Ordinary Least Squares where can specify penalty term.
f <- ols(y ~ ., data = myd_train, method="qr",penalty=0.01)
calibrate
function is for Resampling Model Calibration and Uses bootstrapping or cross-validation to get bias-corrected (overfitting- corrected) estimates of predicted vs. observed values based on subsetting predictions into intervals. The validate
function does resampling validation of a regression model, with or without backward step-down variable deletion.
B = number of repetitions.
For method="crossvalidation", is the number of groups of omitted observations
cal <- calibrate(f, method = "cross validation", B=20)
plot(cal)