Package: cv 2.0.6

Georges Monette

cv: Cross-Validating Regression Models

Cross-validation methods of regression models that exploit features of various modeling functions to improve speed. Some of the methods implemented in the package are novel, as described in Fox and Monette (2026) <doi:10.18637/jss.v116.i08>, and the package vignettes. For general introductions to cross-validation, see, for example, Gareth James, Daniela Witten, Trevor Hastie, and Robert Tibshirani (2021, ISBN 978-1-0716-1417-4, Secs. 5.1, 5.3), "An Introduction to Statistical Learning with Applications in R, Second Edition", and Trevor Hastie, Robert Tibshirani, and Jerome Friedman (2009, ISBN 978-0-387-84857-0, Sec. 7.10), "The Elements of Statistical Learning, Second Edition".

Authors:John Fox [aut], Georges Monette [aut, cre]

cv_2.0.6.tar.gz
cv_2.0.6.zip(r-4.7)cv_2.0.6.zip(r-4.6)cv_2.0.6.zip(r-4.5)
cv_2.0.6.tgz(r-4.6-any)cv_2.0.6.tgz(r-4.5-any)
cv_2.0.6.tar.gz(r-4.7-any)cv_2.0.6.tar.gz(r-4.6-any)
cv_2.0.6.tgz(r-4.6-emscripten)
manual.pdf |manual.html
DESCRIPTION |NEWS
card.svg |card.png
cv/json (API)

# Install 'cv' in R:
install.packages('cv', repos = c('https://gmonette.r-universe.dev', 'https://cloud.r-project.org'))

Bug tracker:https://github.com/gmonette/cv/issues

Pkgdown/docs site:https://gmonette.github.io

Datasets:
  • Pigs - Body Weights of 48 Pigs in 9 Successive Weeks

On CRAN:

Conda:

7.65 score 5 stars 1 packages 118 scripts 486 downloads 20 exports 78 dependencies

Last updated from:7facc7a9f2. Checks:9 OK. Indexed: yes.

TargetResultTimeFilesSyslog
linux-devel-x86_64OK191
source / vignettesOK469
linux-release-x86_64OK195
macos-release-arm64OK109
macos-oldrel-arm64OK114
windows-develOK131
windows-releaseOK114
windows-oldrelOK129
wasm-releaseOK132

Exports:BayesRuleBayesRule2checkFormulacompareFoldscvcvComputecvInfocvMixedcvSelectfoldfoldsGetResponsemedAbsErrmodelsmsermseselectModelListselectStepAICselectTransselectTransStepAIC

Dependencies:abindbackportsbootbroomcarcarDataclicodetoolscolorspacecowplotcpp11DerivdoBydoParalleldplyrfarverforeachforecastFormulafracdiffgenericsggplot2glmmTMBgluegtablegtoolsinsightisobanditeratorslabelinglatticelifecyclelme4lmtestmagrittrMASSMatrixMatrixModelsmgcvmicrobenchmarkminqamodelrnlmenloptrnnetnumDerivpbkrtestpillarpkgconfigpurrrquantregR6rbibutilsRColorBrewerRcppRcppArmadilloRcppEigenRdpackreformulasrlangS7sandwichscalesSparseMstringistringrsurvivaltibbletidyrtidyselecttimeDateTMBurcautf8vctrsviridisLitewithrzoo

Cross-validating regression models
Cross-validation | Examples | Polynomial regression for the Auto data | Using cv() | Comparing competing models | Logistic regression for the Mroz data | Replicating cross-validation | Manipulating "cv" and related objects | Parallel computations | References

Last update: 2026-06-09
Started: 2023-08-03

Cross-validating model selection
A preliminary example | Polynomial regression for the Auto data revisited: meta cross-validation | Mroz's logistic regression revisited | Cross-validating choice of transformations in regression | Selecting both transformations and predictors[^Venables] | References

Last update: 2024-09-15
Started: 2024-04-03

Extending the cv package
Adding a cost criterion | Adding a model class not covered by the default cv() method | Independently sampled cases | Calling cvCompute() | Mixed-effects models | Adding a model-selection procedure | References

Last update: 2024-09-05
Started: 2023-08-25

Computational and technical notes on cross-validating regression models
Efficient computations for linear and generalized linear models | Computation of the bias-corrected CV criterion and confidence intervals | Why the complement of AUC isn't a casewise CV criterion | The values of $\mathrm{cv}(\widehat{y}_i, y_i)$ that express AUC as a sum of casewise values are solutions of equation (\ref{eq:cw}), which can be written as solutions of the following system of $2^{n_v}$ linear simultaneous equations in $2n_v$ unknowns:\begin{equation}\label{eq:lin}\tag{2}(\mathbf{U} -\mathbf{Y}) \mathbf{c}_0 + \mathbf{Y} \mathbf{c}_1 | References

Last update: 2024-09-02
Started: 2024-04-03

Cross-validating mixed-effects models
Example: The High-School and Beyond data | Example: Contrasting cluster-based and case-based CV | Example: Crossed random effects | References

Last update: 2024-09-02
Started: 2024-04-03

Readme and manuals

Help Manual

Help pageTopics
Cross-Validate Regression Modelsas.data.frame.cv as.data.frame.cvList cv cv.default cv.glm cv.lm cv.rlm cvInfo cvInfo.cv cvInfo.cvList cvInfo.cvModList plot.cv plot.cvList print.cv print.cvDataFrame print.cvList summary.cv summary.cvDataFrame summary.cvList
Cross-Validate a Model-Selection Procedurecoef.cvSelect compareFolds cv.function cvInfo.cvSelect selectModelList selectStepAIC selectTrans selectTransStepAIC
Cross-Validate Mixed-Effects Modelcv.glmmTMB cv.lme cv.merMod
Cross-Validate Several Models Fit to the Same Dataas.data.frame.cvModList cv.modList models plot.cvModList print.cvModList summary.cvModList
Utility Functions for the cv PackagecheckFormula cvCompute cvMixed cvSelect fold fold.folds folds GetResponse GetResponse.default GetResponse.glmmTMB GetResponse.lme GetResponse.merMod GetResponse.modList print.folds
Cost Functions for Fitted Regression ModelsBayesRule BayesRule2 costFunctions medAbsErr mse rmse
Body Weights of 48 Pigs in 9 Successive WeeksPigs