Package: nestedcv 0.7.12

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

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>.

Authors:Myles Lewis [aut, cre], Athina Spiliopoulou [aut], Cankut Cubuk [ctb], Katriona Goldmann [ctb]

nestedcv_0.7.12.tar.gz
nestedcv_0.7.12.zip(r-4.5)nestedcv_0.7.12.zip(r-4.4)nestedcv_0.7.12.zip(r-4.3)
nestedcv_0.7.12.tgz(r-4.4-any)nestedcv_0.7.12.tgz(r-4.3-any)
nestedcv_0.7.12.tar.gz(r-4.5-noble)nestedcv_0.7.12.tar.gz(r-4.4-noble)
nestedcv_0.7.12.tgz(r-4.4-emscripten)nestedcv_0.7.12.tgz(r-4.3-emscripten)
nestedcv.pdf |nestedcv.html
nestedcv/json (API)
NEWS

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

Peer review:

Bug tracker:https://github.com/myles-lewis/nestedcv/issues

On CRAN:

7.68 score 10 stars 38 scripts 627 downloads 77 exports 91 dependencies

Last updated 1 days agofrom:9c5da9bbe2. Checks:OK: 7. Indexed: yes.

TargetResultDate
Doc / VignettesOKNov 05 2024
R-4.5-winOKNov 05 2024
R-4.5-linuxOKNov 05 2024
R-4.4-winOKNov 05 2024
R-4.4-macOKNov 05 2024
R-4.3-winOKNov 05 2024
R-4.3-macOKNov 05 2024

Exports:anova_filterbarplot_var_stabilitybin_stat_filterboot_anovaboot_correlboot_filterboot_lmboot_ttestboot_wilcoxonboruta_filterboxplot_expressionclass_balanceclass_stat_filtercollinearcombo_filtercor_stat_filtercorrel_filtercorrels2cv_coefcv_varImpcva.glmnetglmnet_coefsglmnet_filterhist_var_ranksinnercv_predsinnercv_rocinnercv_summarylm_filtermccmcc_multimetricsmodel.hsstannestcv.glmnetnestcv.SuperLearnernestcv.trainone_hotoutercvplot_alphasplot_caretplot_lambdasplot_shap_barplot_shap_beeswarmplot_var_ranksplot_var_stabilityplot_varImppls_filterprcpred_nestcv_glmnetpred_nestcv_glmnet_class1pred_nestcv_glmnet_class2pred_nestcv_glmnet_class3pred_SuperLearnerpred_trainpred_train_class1pred_train_class2pred_train_class3predSummaryrandomsampleranger_filterrelieff_filterrepeatcvrepeatfoldsrf_filterslimsmotestat_filtersummary_varssupervisedPCAtrain_predstrain_roctrain_summaryttest_filtertxtProgressBar2var_directionvar_stabilityweightwilcoxon_filter

Dependencies:bitopscaretcaToolsclasscliclockcodetoolscolorspacecpp11data.tablediagramdigestdoParalleldplyre1071fansifarverforeachfuturefuture.applygenericsggplot2glmnetglobalsgluegowergplotsgtablegtoolshardhatipredisobanditeratorsKernSmoothlabelinglatticelavalifecyclelistenvlubridatemagrittrMASSMatrixmatrixStatsmatrixTestsmgcvModelMetricsmunsellnlmennetnumDerivparallellypillarpkgconfigplyrpROCprodlimprogressrproxypurrrR6RColorBrewerRcppRcppArmadilloRcppEigenRcppGSLRcppParallelRcppZigguratrecipesreshape2RfastRhpcBLASctlrlangROCRrpartscalesshapeSQUAREMstringistringrsurvivaltibbletidyrtidyselecttimechangetimeDatetzdbutf8vctrsviridisLitewithr

Explaining nestedcv models with Shapley values

Rendered fromnestedcv_shap.Rmdusingknitr::rmarkdownon Nov 05 2024.

Last update: 2024-03-12
Started: 2023-03-31

nestedcv

Rendered fromnestedcv.Rmdusingknitr::rmarkdownon Nov 05 2024.

Last update: 2024-08-01
Started: 2022-03-14

Using outercv with Bayesian shrinkage models

Rendered fromnestedcv_hsstan.Rmdusingknitr::rmarkdownon Nov 05 2024.

Last update: 2024-03-12
Started: 2023-03-25

Readme and manuals

Help Manual

Help pageTopics
Barplot variable stabilitybarplot_var_stability
Bootstrap for filter functionsboot_filter
Bootstrap univariate filtersboot_anova boot_correl boot_lm boot_ttest boot_wilcoxon
Boruta filterboruta_filter
Boxplot expression levels of model predictorsboxplot_expression
Check class balance in training foldsclass_balance class_balance.default class_balance.nestcv.train
Extract coefficients from a cva.glmnet objectcoef.cva.glmnet
Extract coefficients from nestcv.glmnet objectcoef.nestcv.glmnet
Filter to reduce collinearity in predictorscollinear
Combo filtercombo_filter
Correlation between a vector and a matrixcorrels2
Coefficients from outer CV glmnet modelscv_coef
Extract variable importance from outer CV caret modelscv_varImp
Cross-validation of alpha for glmnetcva.glmnet
glmnet coefficientsglmnet_coefs
glmnet filterglmnet_filter
Inner CV predictionsinnercv_preds innercv_preds.nestcv.glmnet innercv_preds.nestcv.train
Build ROC curve from left-out folds from inner CVinnercv_roc
Summarise performance on inner CV test foldsinnercv_summary
Add precision-recall curve to a plotlines.prc
Linear model filterlm_filter
Matthews correlation coefficientmcc mcc_multi
Model performance metricsmetrics
hsstan model for cross-validationmodel.hsstan
Nested cross-validation with glmnetnestcv.glmnet
Outer cross-validation of SuperLearner modelnestcv.SuperLearner
Nested cross-validation for caretnestcv.train
One-hot encodeone_hot
Outer cross-validation of selected modelsoutercv outercv.default outercv.formula
Plot cross-validated glmnet alphaplot_alphas
Plot caret tuningplot_caret
Plot cross-validated glmnet lambdas across outer foldsplot_lambdas
SHAP importance bar plotplot_shap_bar
SHAP importance beeswarm plotplot_shap_beeswarm
Plot variable importance rankingshist_var_ranks plot_var_ranks
Plot variable stabilityplot_var_stability
Variable importance plotplot_varImp
Plot lambda across range of alphasplot.cva.glmnet
Plot precision-recall curveplot.prc
Partial Least Squares filterpls_filter
Build precision-recall curveprc prc.data.frame prc.default prc.nestcv.glmnet prc.nestcv.SuperLearner prc.nestcv.train prc.outercv prc.repeatcv
Prediction wrappers to use fastshap with nestedcvpred_nestcv_glmnet pred_nestcv_glmnet_class1 pred_nestcv_glmnet_class2 pred_nestcv_glmnet_class3 pred_SuperLearner pred_train pred_train_class1 pred_train_class2 pred_train_class3
Predict method for cva.glmnet modelspredict.cva.glmnet
Predict from hsstan model fitted within cross-validationpredict.hsstan
Predict method for nestcv.glmnet fitspredict.nestcv.glmnet
Summarise prediction performance metricspredSummary
Oversampling and undersamplingrandomsample
Random forest ranger filterranger_filter
ReliefF filterrelieff_filter
Repeated nested CVrepeatcv
Create folds for repeated nested CVrepeatfolds
Random forest filterrf_filter
Slim nestedcv modelsslim
SMOTEsmote
Univariate filter for binary classification with mixed predictor datatypesbin_stat_filter class_stat_filter cor_stat_filter stat_filter
Summarise variablessummary_vars
Supervised PCA plotsupervisedPCA
Outer training fold predictionstrain_preds
Build ROC curve from outer CV training foldstrain_roc
Summarise performance on outer training foldstrain_summary
Univariate filtersanova_filter correl_filter ttest_filter wilcoxon_filter
Text Progress Bar 2txtProgressBar2
Variable directionalityvar_direction
Variable stabilityvar_stability var_stability.nestcv.glmnet var_stability.nestcv.train var_stability.repeatcv
Calculate weights for class imbalanceweight