nadir 1.0.0
This release marks nadir’s readiness to submit to rOpenSci for peer review, and incorporates everything described under 0.0.2 below (which was a development version and was never released to CRAN).
Breaking changes
- Learner backend packages (e.g.,
glmnet,ranger,xgboost,lightgbm,dbarts,e1071,earth,gbm,hal9001,kernlab,kknn,lme4,mgcv,nnet,randomForest,rpart,VGAM, and others) have been moved fromImportstoSuggests, in order to reduce nadir’s installation footprint. Users only need to install the backends for the learners they actually use. A new internalrequire_backend()check is called throughout, so attempting to use a learner whose backend is not installed produces an informative error naming the package to install.
Documentation and vignettes
- New Glossary article defining the technical terms used throughout the package documentation (cross-fitting, out-of-fold predictions, metalearning, and so on).
- New Translation Guide article for users arriving from SuperLearner or sl3, which supersedes and replaces the previous comparison article.
- Expanded the Guidance for Developers article and FAQs.
Internal changes
- Completed
pkgcheck::pkgcheck()compatibility in preparation for rOpenSci submission. - Tests for Suggests-backed learners are now skipped gracefully when the corresponding backend package is not installed.
nadir 0.0.2
New features
-
crossfit_super_learner()is a newly available method for cross-fitting super learners;cv_super_learner()has been reworked to usecrossfit_super_learner()internally. -
super_learner()output gains$oof_predictions()and$oof_predict_modified()for accessing and working with out-of-fold predictions, alongside$oof_predict()and$oof_predict_fold(). - New
train_on_whole_datasetargument tosuper_learner()(defaultTRUE) allows users to skip refitting learners on the full dataset after cross-validation. -
add_stratification()added for stratified learner construction. -
truncate_lnr()added for bounding a learner’s predictions between user-specified minimum and maximum values. - Learners that error or warn during fitting now have their messages captured and stored for user inspection rather than cluttering the console; a new vignette covers timing learners via warnings.
- Support for multi-predictors: learners that return lists of multiple predictors, via
as_multi_predictor(). - Formulas may now be passed as character strings (including a single string recycled across learners), which are handled via
as.formula(). - Fit learners are now returned as part of the super learner object (
$fit_learners). -
$predict()on super learned models improved, including support fornewdatathat omits the outcome column.
New learners
-
lnr_lightgbm()(LightGBM) -
lnr_bart()(Bayesian Additive Regression Trees), with careful handling of prediction closures when categorical variables are present -
lnr_knn()andlnr_knn_binary()(k-nearest neighbors) -
lnr_svm()andlnr_svm_binary()(support vector machines) -
lnr_cvglmnet()(cross-validated glmnet)
New S3 methods
-
nadir_sl_modelandnadir_crossfit_slobjects gainprint(),plot(),summary(),coef(),nobs(),formula(),fitted(), andresiduals()methods. -
plot()method added fornadir_cv_slobjects. -
fitted()andresiduals()are returned in the row-order of the input data via an internal.sl_rowid, with tests ensuring correctness on out-of-order and shuffled inputs.
Bug fixes
- Fixed predictions on data whose columns are out of order relative to the training data.
- Fixed an
obs_weightsbug in weight determination. -
lnr_glmnet()(andlnr_glmnet_grid()) now work even when some factor levels contain zero observations; rare-factor handling also added tolnr_hal()andlnr_hal_grid(). - Fixed a bug in
lnr_gbm()when aweights = NULLargument was passed. - Fixed bugs in
lnr_xgboost()andlnr_lightgbm(); updatedlnr_xgboost()so binary learners work again. - Fixed
n_foldshandling incv_super_learner(). -
cv_origami_schema()now errors informatively on non-discretecluster_ids/strata_ids. - The negative log loss for binary outcomes now truncates predicted probabilities (following the same truncation scheme as
sl3) to avoid-log(0) = Inf. - Weight determination now checks edge cases: a single learner, and all-zero model weights (falling back to equal weights), with informative errors added throughout
determine_weights_*(). - Outcome variables are now validated against the specified outcome type.
-
match.arg()is now used on all categorical arguments. - Added a check for datasets that are too small to cross-validate (srr G5.8a).
Documentation and vignettes
- New vignette on glmnet and HAL approaches to determining weights.
- Updated the basic examples vignette to be more illustrative, and clarified the multiclass prediction vignette.
- Removed
super_learner()from the comparison plot shown byplot.nadir_sl_model()to avoid overstating performance. - Many documentation improvements: all arguments documented, ORCID iD format updated, removal of links and
:::usage flagged by CRAN, and shorter examples to respect CRAN’s runtime limits.
rOpenSci preparation and internal changes
- Added
srrstatsstandards tags throughout the package in preparation for rOpenSci submission. - Package passes
pkgcheck::pkgcheck(); removed unused code and improved docs in response. - Added
lintrconfiguration and resolved lints (&&/||inif,seq_len()/seq_along(), removal of commented-out and unused code, line-width limits);lintralso caught a never-called validation function, which is now wired in. - Ran
styler::style_pkg()across the package. - Expanded the testing suite substantially, including new tests for cross-fitting methods, learner leakage, character formulas, and input ordering.
- Continuous Integration: removed slow ubuntu-devel/oldrel workflows that spent excessive time installing dependencies.
