Machine Learning for Complex Survey Data

Fits weighted machine learning models for complex survey data using a replicate weights approach that accounts for sampling weights, strata, and clusters. Weighted versions of Elastic Net, XGBoost, and random forest are provided for linear and logistic regression, along with parallelized tuning-parameter search and companion plotting methods.


MLSurvey

Machine Learning for Complex Survey Data

R-CMD-check

MLSurvey is a R-package to develop Machine Learning models for complex survey data using suitable Cross-Validation methods: replicate weights methods. This ML tool currently offers weighted Elastic Net (wElnet) for a single $\alpha$, its CPU parallel computing (par_wElnet) for a sequence of $\alpha$'s, generic plots (plot) and ggplot2 supported counterparts (autoplot) for both computation results. It also supports weighted random forest (wRandomforest), and weighted XGBoost (wXGBoost) with random optimal (hyper-)parameter search (optim_wxgb_para). Confidential interval (ci_wauc) for weighted area under the ROC curve (wAUC) is computed by bootstrap.

Since all the weighted ML methods are extended by existing algorithms, glmnet, xgboost, and randomForest, final models can benefit from the functionality of corresponding original packages to get more comprehensive results, such as importance plots, prediction, etc. NOTE : The package is developed for linear/logistic regression. For other models supported by their parent packages, the weighted counterparts can be developed depending on demand.

FYI, all weighted performance metrics-- wAUC, wROC, wSensitivity, and wSpecificity--can be computed by R-svyROC. All the ML methods are incorporated with replicate weights methods: JKn, bootstrap, subbootstrap, BRR by R-survey, dCV, split, and extrapolation by R-svyVarSel.

A brief start guide can be found in vignettes.

Paper

  • Kim, H., Rogers, P. and Wang, D. (2026) 'Machine learning models for chronic disease risks using complex survey data: the impact of sample weights', Front. Digit. Health, 8:1834715. doi: 10.3389/fdgth.2026.1834715

Installation

To install from CRAN,

install.packages("MLSurvey")
library(MLSurvey)

To install from the source (GitHub),

library(devtools)
install_github("hkim-fda/MLSurvey")

Or simply,

devtools::install_github("hkim-fda/MLSurvey")

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("MLSurvey")

1.0.2 by Hyeonju Kim, 11 hours ago


Browse source code at https://github.com/cran/MLSurvey


Authors: Hyeonju Kim [aut, cre]


Documentation:   PDF Manual  


GPL (>= 3) license


Imports glmnet, ggplot2, graphics, grDevices, parallel, randomForest, rlang, stats, survey, svyROC, utils, xgboost

Suggests Matrix, knitr, rmarkdown, RhpcBLASctl, patchwork, testthat


See at CRAN