Package: glmnetr 0.5-4

Walter K Kremers

glmnetr: Nested Cross Validation for the Relaxed Lasso and Other Machine Learning Models

Cross validation informed Relaxed LASSO, Artificial Neural Network (ANN), gradient boosting machine ('xgboost'), Random Forest ('RandomForestSRC'), Oblique Random Forest ('aorsf'), Recursive Partitioning ('RPART') or step wise regression models are fit. Cross validation leave out samples (leading to nested cross validation) or bootstrap out-of-bag samples are used to evaluate and compare performances between these models with results presented in tabular or graphical means. Calibration plots can also be generated, again based upon (outer nested) cross validation or bootstrap leave out (out of bag) samples. For some datasets, for example when the design matrix is not of full rank, 'glmnet' may have very long run times when fitting the relaxed lasso model, from our experience when fitting Cox models on data with many predictors and many patients, making it difficult to get solutions from either glmnet() or cv.glmnet(). This may be remedied by using the 'path=TRUE' option when calling glmnet() and cv.glmnet(). Within the glmnetr package the approach of path=TRUE is taken by default. When fitting not a relaxed lasso model but an elastic-net model, then the R-packages 'nestedcv' <https://cran.r-project.org/package=nestedcv>, 'glmnetSE' <https://cran.r-project.org/package=glmnetSE> or others may provide greater functionality when performing a nested CV. Use of the 'glmnetr' has many similarities to the 'glmnet' package and it is recommended that the user of 'glmnetr' also become familiar with the 'glmnet' package <https://cran.r-project.org/package=glmnet>, with the "An Introduction to 'glmnet'" and "The Relaxed Lasso" being especially useful in this regard.

Authors:Walter K Kremers [aut, cre], Nicholas B Larson [ctb]

glmnetr_0.5-4.tar.gz
glmnetr_0.5-4.tar.gz(r-4.5-noble)glmnetr_0.5-4.tar.gz(r-4.4-noble)
glmnetr_0.5-4.tgz(r-4.4-emscripten)glmnetr_0.5-4.tgz(r-4.3-emscripten)
glmnetr.pdf |glmnetr.html
glmnetr/json (API)

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

Peer review:

This package does not link to any Github/Gitlab/R-forge repository. No issue tracker or development information is available.

3.70 score 2 scripts 779 downloads 35 exports 109 dependencies

Last updated 29 days agofrom:d3066b88b4. Checks:OK: 1 NOTE: 1. Indexed: yes.

TargetResultDate
Doc / VignettesOKOct 25 2024
R-4.5-linuxNOTEOct 25 2024

Exports:aicregann_tab_cvann_tab_cv_bestbest.predsboot.factor.foldidcalcelosscalplotcox.sat.devcv.glmnetrcv.stepregdevrat_diff_timediff_time1factor.foldidget.foldidget.id.foldidglmnetrglmnetr_seedglmnetr.cisglmnetr.compcvglmnetr.simdatanested.cisnested.comparenested.glmnetrorf_tuneplot_perf_glmnetrpredict_ann_tabrederive_orfrederive_rfrederive_xgbrf_tuneroundperfstepregxgb.simplexgb.tuned

Dependencies:aorsfbackportsbase64encBBmiscbitbit64bslibcachemcallrcheckmateclicliprcodetoolscollapsecolorspacecorocpp11crayondata.tabledata.treedescDiagrammeRDiceKrigingdigestdplyrellipsisevaluatefansifarverfastmapfastmatchfontawesomeforeachfsgenericsggplot2glmnetgluegtablehighrhmshtmltoolshtmlwidgetsigraphisobanditeratorsjquerylibjsonliteknitrlabelinglatticelhslifecyclemagrittrMASSMatrixmemoisemgcvmimemlrmlrMBOmunsellnlmeparallelMapParamHelperspillarpkgconfigprettyunitsprocessxprogresspspurrrR6randomForestSRCrappdirsRColorBrewerRcppRcppArmadilloRcppEigenreadrrgenoudrlangrmarkdownrpartrstudioapisafetensorssassscalesshapesmoofstringistringrsurvivaltibbletidyrtidyselecttinytextorchtzdbutf8vctrsviridisLitevisNetworkvroomwithrxfunxgboostXMLyaml

An Overview of glmnetr

Rendered fromAn_Overview_of_glmnetr_241024.pdf.asisusingR.rsp::asison Oct 25 2024.

Last update: 2024-10-24
Started: 2024-10-24

Calibration of Machine Learning Models

Rendered fromCalibration_241024.pdf.asisusingR.rsp::asison Oct 25 2024.

Last update: 2024-10-24
Started: 2024-10-24

Ridge and Lasso

Rendered fromRidge_and_Lasso_241024.pdf.asisusingR.rsp::asison Oct 25 2024.

Last update: 2024-10-24
Started: 2024-10-24

Using ann_tab_cv

Rendered fromUsing_ann_tab_cv_241024.pdf.asisusingR.rsp::asison Oct 25 2024.

Last update: 2024-10-24
Started: 2024-10-24

Using stepreg

Rendered fromUsing_stepreg_241024.pdf.asisusingR.rsp::asison Oct 25 2024.

Last update: 2024-10-24
Started: 2024-10-24

Readme and manuals

Help Manual

Help pageTopics
Identify model based upon AIC criteria from a stepreg() putputaicreg
Fit an Artificial Neural Network model on "tabular" provided as a matrix, optionally allowing for an offset termann_tab_cv
Fit multiple Artificial Neural Network models on "tabular" provided as a matrix, and keep the best one.ann_tab_cv_best
Get the best models for the steps of a stepreg() fitbest.preds
Generate foldid's by 0/1 factor for bootstrap like samples where unique option between 0 and 1boot.factor.foldid
calculate cross-entry for multinomial outcomescalceloss
Construct calibration plots for a nested.glmnetr output objectcalplot
Calculate the CoxPH saturated log-likelihoodcox.sat.dev
Get a cross validation informed relaxed lasso model fit.cv.glmnetr
Cross validation informed stepwise regression model fit.cv.stepreg
Calculate deviance ratios for CV baseddevrat_
Output to console the elapsed and split timesdiff_time
Get elapsed time in c(hour, minute, secs)diff_time1
Generate foldid's by factor levelsfactor.foldid
Get foldid's with branching for cox, binomial and gaussian modelsget.foldid
Get foldid's when id variable is used to identify groups of dependent sampling units. With branching for cox, binomial and gaussian modelsget.id.foldid
Fit relaxed part of lasso modelglmnetr
Get seeds to store, facilitating replicable resultsglmnetr_seed
A redirect to nested.cis()glmnetr.cis
A redirect to nested.compareglmnetr.compcv
Generate example dataglmnetr.simdata
Calculate performance measure CI's and p'snested.cis
Compare cross validation fit performances from a nested.glmnetr output.nested.compare
Using (nested) cross validation, describe and compare some machine learning model performancesnested.glmnetr
Fit a Random Forest model on data provided in matrix and vector formats.orf_tune
Plot nested cross validation performance summariesplot_perf_glmnetr
Plot cross-validation deviances, or model coefficients.plot.cv.glmnetr
Plot the relaxed lasso coefficients.plot.glmnetr
Plot results from a nested.glmnetr() outputplot.nested.glmnetr
Get predicteds for an Artificial Neural Network model fit in nested.glmnetr()predict_ann_tab
Give predicteds based upon a cv.glmnetr() output object.predict.cv.glmnetr
Beta's or predicteds based upon a cv.stepreg() output object.predict.cv.stepreg
Get predicteds or coefficients using a glmnetr output objectpredict.glmnetr
Give predicteds based upon the cv.glmnet output object contained in the nested.glmnetr output object.predict.nested.glmnetr
A redirect to the summary() function for nested.glmnetr() output objectsprint.nested.glmnetr
Print output from orf_tune() functionprint.orf_tune
Print output from rf_tune() functionprint.rf_tune
Rederive Oblique Random Forest models not kept in nested.glmnetr() outputrederive_orf
Rederive Random Forest models not kept in nested.glmnetr() outputrederive_rf
Rederive XGB models not kept in nested.glmnetr() outputrederive_xgb
Fit a Random Forest model on data provided in matrix and vector formats.rf_tune
round elements of a summary.glmnetr() outputroundperf
Fit the steps of a stepwise regression.stepreg
Output summary of a cv.glmnetr() output object.summary.cv.glmnetr
Summarize results from a cv.stepreg() output object.summary.cv.stepreg
Summarize a nested.glmnetr() output objectsummary.nested.glmnetr
Summarize output from rf_tune() functionsummary.orf_tune
Summarize output from rf_tune() functionsummary.rf_tune
Briefly summarize steps in a stepreg() output object, i.e. a stepwise regression fitsummary.stepreg
Get a simple XGBoost model fit (no tuning)xgb.simple
Get a tuned XGBoost model fitxgb.tuned