The hardware and bandwidth for this mirror is donated by METANET, the Webhosting and Full Service-Cloud Provider.
If you wish to report a bug, or if you are interested in having us mirror your free-software or open-source project, please feel free to contact us at mirror[@]metanet.ch.
This package provides efficient implementations of cross-validation techniques for linear and ridge regression models, leveraging C++ code with Rcpp, RcppParallel, and Eigen libraries. It supports leave-one-out, generalized, and K-fold cross-validation methods, utilizing Eigen matrices for high performance.
This code is adapted and extended from various sources, leveraging the capabilities of the following:
Please refer to the source files for detailed information and licenses.
This code is under MIT License.
library(cvLM)
data(mtcars)
<- nrow(mtcars)
n
# Formula method
cvLM(
~ .,
mpg data = mtcars,
K.vals = n, # Leave-one-out CV
lambda = 10 # Shrinkage parameter of 10
)
# lm method
<- lm(mpg ~ ., data = mtcars)
my.lm cvLM(
my.lm,data = mtcars,
K.vals = c(5L, 8L), # Perform both 5- and 8-fold CV
n.threads = 8L, # Allow up to 8 threads for computation
seed = 1234L
)
# glm method
<- glm(mpg ~ ., data = mtcars)
my.glm cvLM(
my.glm,data = mtcars,
K.vals = n, generalized = TRUE # Use generalized CV
)
These binaries (installable software) and packages are in development.
They may not be fully stable and should be used with caution. We make no claims about them.