Skip to content

nestedcv

0.9.0

Nested Cross-Validation with 'glmnet' and 'caret'

0packages dependsuggested by 1
9.2Kdownloads / year
–test coverage
7/13flavors OK

Overview

About

Implements nested k*l-fold cross-validation for lasso and elastic-net regularised linear models via the 'glmnet' package and other machine learning models via the 'caret' package doi:10.1093/bioadv/vbad048. Cross-validation of 'glmnet' alpha mixing parameter and embedded fast filter functions for feature selection are provided. Described as double cross-validation by Stone (1977) doi:10.1111/j.2517-6161.1977.tb01603.x. Also implemented is a method using outer CV to measure unbiased model performance metrics when fitting Bayesian linear and logistic regression shrinkage models using the horseshoe prior over parameters to encourage a sparse model as described by Piironen & Vehtari (2017) doi:10.1214/17-EJS1337SI.

Changes in 0.9.0

13/07/2026

  • Added nestcv.explain(), a wrapper around shapr::explain()

for generating SHAP values from nestedcv models, replacing the

fastshap-based workflow due to the removal of fastshap from CRAN.

Returns the shapr object directly, so shapr print() and plot()

methods can be used; plot_shap_bar() and plot_shap_beeswarm() also accept

this object directly.

  • Fixed pred_train(), pred_train_class() and pred_SuperLearner()

erroring when called with a data.table (as shapr::explain() does

internally) by changing newdata to a data frame.

  • nestedcv still works with fastshap for users who prefer it; the

pred_* wrapper functions remain usable directly with fastshap::explain().

Show all changes in 0.9.0Hide the rest of the changes in 0.9.0
  • Small fixes to handle updates to ggplot2.

From NEWS.md in the release

Install

Health

CRAN checks
6NOTE7OK
Check messages
NOTERd cross-referencesr-devel-linux-x86_64-debian-clang, r-devel-linux-x86_64-debian-gcc, r-devel-linux-x86_64-fedora-clang, r-devel-linux-x86_64-fedora-gcc, r-patched-linux-x86_64, r-release-linux-x86_64
Unknown package ‘CORElearn’ in Rd xrefs

CRAN check page ↗

Slowest check: 12.0 min · r-oldrel-windows-x86_64
Status changes
  • NOTE7 OK, 6 NOTENow
  • NOTE8 OK, 1 NOTE2026-07-16
  • OK8 OK2026-07-15
  • ERROR11 OK, 2 ERROR2026-05-28
  • OK14 OK2026-03-10
Advisories

none known

Documentation

In release 0.9.0
READMEYes · 240 wordsVignettesYes · 3 · dynamicNEWSYes · 100% structured · mentions 0.9.0Citation fileYes · cites a publicationWebsitenot declared in DESCRIPTION
Help pages
66
Examples that run
31%5 run in a plain check (2 of them under a condition) · 11 only when donttest examples are enabled (R CMD check --as-cran)
Exported functions with examples
26%
Documented parameters
100%
Return-value docs
100%
Help pages citing references
5%

Downloads

9.2K
CRAN downloads in the past year
Rank #4,544 · ~25/day · ~770/mo
Daily download trend is not available in this view yet.
70230 days
1.8K90 days
9.2K1 year
Compare downloads with other packages →
Also on131 r2u6 autocran49 c2d4u

Repository

17Stars
8Forks
3Open issues
1Open PRs
16Releases
1,021Commits
6Commit identities
1,021 commits · Last activity 2026-07-13
Responsiveness
How these are sampled
PRs merged (all time)
87%
Median days to close, 50 most recently updated closed issues
5
Median days to close, 50 most recently updated closed PRs
0

Forks over time

2026-07-15 · 72026-09-05 · 8
PracticesBeta

3 development-tooling and community-health practices detected across 2 families in the upstream repository

Checks run against github.com/myles-lewis/nestedcv on 2026-10-11.

CRAN release process (2)
cran-comments.mdCRAN-SUBMISSION
Git structural (1)
.gitattributes
How this is detected·Detection ruleset v3 (2026-09-26)

Dependencies

Declared dependencies
31 external dependencies (excludes base and recommended)

Installing nestedcv adds 78 packages (45 with compiled code, 60 MB of source tarballs). Heaviest: stringi 11 MB, ggplot2 6.0 MB, data.table 5.7 MB.

Depends (1)
R >= 4.1.0
LinkingTo (0)
none
Enhances (0)
none
Reverse dependencies
0direct
0indirect
Suggested by 1
Suggests, most downloaded first

People & History

People (6)
Author, Maintainer since 0.2.3 (2022)
Contributor · added in 0.7.8
Contributor
Contributor · added in 0.9.0
Contributor · added in 0.8.0
Releases (20)

Pick two releases to compare their code metrics.

  • unarchivedReturned to CRAN
    2026-07-14
  • 0.9.0Latest
    record
    2026-07-14 · current release · diff ↗ ·
    added 1 export
    nestcv.explain
  • archivedRemoved from CRAN
    2026-06-10
    issues were not corrected in time
  • R
    R 4.6.0 released · 2026-04-24
  • unarchivedReturned to CRAN
    2026-04-10
  • 0.8.2
    record
    2026-04-10 · diff ↗
  • archivedRemoved from CRAN
    2026-03-31
    issues were not corrected in time
  • R
    R 4.5.0 released · 2025-04-11
  • 0.8.0
    record
    2025-03-10 · diff ↗ ·
    removed 6 exports
    pred_nestcv_glmnet_class1, pred_nestcv_glmnet_class2, pred_nestcv_glmnet_class3, pred_train_class1, pred_train_class2, pred_train_class3
    added 2 exports
    pred_nestcv_glmnet_class, pred_train_class
  • 0.7.12
    record
    2024-11-27 · diff ↗ ·
    added 3 exports
    hist_var_ranks, plot_var_ranks, slim
  • 0.7.10
    record
    2024-08-16 · diff ↗ ·
    added 2 exports
    mcc, mcc_multi
  • 0.7.9
    record
    2024-07-04 · diff ↗
  • R
    R 4.4.0 released · 2024-04-24
  • 0.7.8
    record
    2024-03-13 · diff ↗ ·
    removed 1 export
    layer_filter
    added 3 exports
    metrics, pls_filter, prc
  • 0.7.4
    record
    2024-01-30 · diff ↗
  • 0.7.3
    record
    2023-12-04 · diff ↗ ·
    removed 1 export
    boxplot_model
    added 5 exports
    boxplot_expression, pred_SuperLearner, repeatcv, repeatfolds, txtProgressBar2
Show 13 earlier eventsHide 13 earlier events
  • 0.7.0
    record
    2023-10-26 · diff ↗
  • 0.6.9
    record
    2023-08-22 · diff ↗
  • 0.6.7
    record
    2023-07-02 · diff ↗ ·
    added 5 exports
    bin_stat_filter, class_stat_filter, cor_stat_filter, one_hot, stat_filter
  • 0.6.6
    record
    2023-06-08 · diff ↗
  • 0.6.4
    record
    2023-05-30 · diff ↗
  • 0.6.2
    record
    2023-05-15 · diff ↗
  • R
    R 4.3.0 released · 2023-04-21
  • 0.6.1
    record
    2023-04-16 · diff ↗ ·
    added 17 exports
    barplot_var_stability, cv_coef, cv_varImp, plot_shap_bar, plot_shap_beeswarm, plot_var_stability, pred_nestcv_glmnet, pred_nestcv_glmnet_class1, pred_nestcv_glmnet_class2, pred_nestcv_glmnet_class3, pred_train, pred_train_class1, pred_train_class2, pred_train_class3, ranger_filter, var_direction, var_stability
  • 0.4.4
    record
    2022-12-05 · diff ↗ ·
    added 5 exports
    innercv_preds, innercv_summary, train_preds, train_roc, train_summary
  • 0.4.0
    record
    2022-10-23 · diff ↗ ·
    added 4 exports
    layer_filter, nestcv.SuperLearner, supervisedPCA, weight
  • 0.3.0
    record
    2022-09-10 · diff ↗ ·
    added 11 exports
    boot_anova, boot_correl, boot_filter, boot_lm, boot_ttest, boot_wilcoxon, class_balance, plot_varImp, randomsample, smote, summary_vars
  • 0.2.3
    record
    2022-07-07
  • R
    R 4.2.0 released · 2022-04-22

Package metadata

First published
2022-07-07
Total releases
20 / 4 yrs
License
MIT + file LICENSE OSI
Minimum R
≥ 4.1.0
Download size
2.5 MB

Cite

Cite this package

Run in R for the authors' entry:

citation("nestedcv")

The package provides a citation file, so citation() returns the authors' own entry.

It points to 10.1093/bioadv/vbad048.

Cite the R Observatory

For a number measured here: a download total, a coverage figure, an archival date.

APA

Balamuta, J. J. (2026). R Observatory: Metrics for nestedcv version 0.9.0 [Data set]. HJJB, LLC. Data release v2026-10-17. https://doi.org/10.5281/zenodo.21843040

From data release v2026-10-17, which the citation names so these numbers can be found later. More on citing and the projects behind them.

Report a problem with this page →

Privacy choices

These apply to this browser and are stored on this device only. Nothing about your choice is sent to us.

Read the privacy policy