Package: pre 1.1.1

pre: Prediction Rule Ensembles

Fits prediction rule ensembles (PREs). Largely follows the procedure for deriving PREs as described in Friedman & Popescu (2008; <doi:10.1214/07-AOAS148>), with adjustments and improvements described in Fokkema (2020; <doi:10.18637/jss.v092.i12>) and Fokkema & Strobl (2020; <doi:10.1037/met0000256>). The main function pre() derives prediction rule ensembles consisting of rules and/or linear terms for continuous, binary, count, multinomial, survival and multivariate continuous responses. Function gpe() derives generalized prediction ensembles, consisting of rules, hinge and linear functions of the predictor variables.

Authors:Marjolein Fokkema [aut, cre], Benjamin Christoffersen [aut], Giorgio Spadaccini [ctb]

pre_1.1.1.tar.gz
pre_1.1.1.zip(r-4.7-any)pre_1.1.1.zip(r-4.6-any)pre_1.1.1.zip(r-4.5-any)
pre_1.1.1.tgz(r-4.6-any)pre_1.1.1.tgz(r-4.5-any)
pre_1.1.1.tar.gz(r-4.7-any)pre_1.1.1.tar.gz(r-4.6-any)
pre_1.1.1.tgz(r-4.6-emscripten)
manual.pdf |manual.html✨
DESCRIPTION |NEWS
card.svg |card.png
pre/json (API)

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

Bug tracker:https://github.com/marjoleinf/pre/issues

Datasets:
  • carrillo - Data on personality characteristics and depressive symptom severity

On CRAN:

Conda:

9.36 score 58 stars 2 packages 132 scripts 2.2k downloads 3 mentions 26 exports 31 dependencies

Last updated from:34e0f86d89. Checks:4 OK. Indexed: yes.

TargetResultTimeFilesSyslog
source / vignettesOK348
macos-releaseOK146
windows-releaseOK151
wasm-releaseOK155

Exports:bsnullinteractcaret_pre_modelcorplotcvpreeTermexplaingpegpe_cv.glmnetgpe_earthgpe_lineargpe_rules_pregpe_samplegpe_treesimportanceinteractlTermmaxdepth_samplermi_meanmi_prepairplotpreprune_prerare_level_samplerrTermshapsingleplot

Dependencies:clicodetoolsearthforeachFormulaglmnetglueinumiteratorslatticelibcoinlifecyclemagrittrMatrixMatrixModelsmvtnormpartykitplotmoplotrixRcppRcppEigenrlangrpartsandwichshapestringistringrstrucchangesurvivalvctrszoo

Computing SHAP values for rule ensembles
Introduction | Example: Fitting a rule ensemble | Computing marginal SHAP values | Visualizing marginal SHAP values | Visualizing marginal SHAP values with beeswarms and waterfall plots using package shapviz | Computing interaction SHAP values | Understanding (interaction) SHAP values | Visualizing interaction SHAP values | Session info | References

Last update: 2026-10-13
Started: 2026-10-13

Dealing with missing data in fitting prediction rule ensembles
Introduction | Example: Predicting wind speed | Listwise Deletion | Single Imputation | Multiple Imputation | Stacking imputed datasets | Pooling | Comparing accuracy and sparsity | Session info | References

Last update: 2026-10-13
Started: 2022-02-24

More adaptive or relaxed: Fitting sparser rule ensembles with relaxed and/or adaptive lasso
Introduction | Relaxed lasso | Adaptive lasso | Relaxed adaptive lasso | Example: Predicting Ozone levels with relaxed and/or adaptive lasso | Forward stepwise selection with the relaxed lasso | Conclusion | Session info | References

Last update: 2026-10-13
Started: 2022-03-15

Tuning parameters of function pre
Introduction | Tuning parameters | Tuning parameters using package caret | Using Breiman's random forests for rule generation | References

Last update: 2026-10-13
Started: 2022-02-24

Speeding up computations
Faster rule generation | Tree fitting algorithm | Maximum rule depth | Number of trees | Faster estimation of the final ensemble | Parallel computation | Number of cross-validation folds | References

Last update: 2025-04-02
Started: 2024-01-12

Readme and manuals

Help Manual

Help pageTopics
Compute bootstrapped null interaction prediction rule ensemblesbsnullinteract
Model set up for train function of package caretcaret_pre_model
Data on personality characteristics and depressive symptom severitycarrillo
Coefficients for a General Prediction Ensemble (gpe)coef.gpe
Coefficients for the final prediction rule ensemblecoef.pre
Plot correlations between baselearners in a prediction rule ensemble (pre)corplot
Full k-fold cross validation of a prediction rule ensemble (pre)cvpre
Explain predictions from final prediction rule ensembleexplain
Derive a General Prediction Ensemble (gpe)gpe
Default penalized trainer for gpegpe_cv.glmnet
Get rule learner for gpe which mimics behavior of pregpe_rules_pre
Sampling Function Generator for gpegpe_sample
Learner Functions Generators for gpegpe_earth gpe_linear gpe_trees
Calculate importances of baselearners and input variables in a prediction rule ensemble (pre)importance importance.pre
Calculate interaction statistics for variables in a prediction rule ensemble (pre)interact
Sampling function generator for specifying varying maximum tree depth in a prediction rule ensemble (pre)maxdepth_sampler
Compute the average dataset over imputed datasets.mi_mean
Fit a prediction rule ensemble to multiply-imputed data (experimental)mi_pre
Create partial dependence plot for a pair of predictor variables in a prediction rule ensemble (pre)pairplot
Plot method for class preplot.pre
Derive a prediction rule ensemblepre
Predicted values based on gpe ensemblepredict.gpe
Predicted values based on final prediction rule ensemblepredict.pre
Print a General Prediction Ensemble (gpe)print.gpe
Print method for objects of class preprint.pre
Get the optimal lambda and gamma parameter values for an ensemble of given sizeprune_pre
Dealing with rare factor levels in fitting prediction rule ensembles.rare_level_sampler
Wrapper Functions for terms in gpeeTerm lTerm rTerm
Compute matrices that identify the rulesRuleMats
Compute SHAP values for a prediction rule ensembleshap
Compute a matrix with SHAP values of each ruleShapleyMats
Create partial dependence plot for a single variable in a prediction rule ensemble (pre)singleplot
Summary method for a General Prediction Ensemble (gpe)summary.gpe
Summary method for objects of class presummary.pre