pre (version 0.7.2)

bsnullinteract: Compute bootstrapped null interaction prediction rule ensembles

Description

bsnullinteract generates bootstrapped null interaction models, which can be used to derive a reference distribution of the test statistic calculated with interact.

Usage

bsnullinteract(object, nsamp = 10, parallel = FALSE,
  penalty.par.val = "lambda.1se", verbose = FALSE)

Arguments

object

object of class pre.

nsamp

numeric. Number of bootstrapped null interaction models to be derived.

parallel

logical. Should parallel foreach be used to generate initial ensemble? Must register parallel beforehand, such as doMC or others.

penalty.par.val

character or numeric. Value of the penalty parameter \(\lambda\) to be employed for selecting the final ensemble. The default "lambda.min" employs the \(\lambda\) value within 1 standard error of the minimum cross-validated error. Alternatively, "lambda.min" may be specified, to employ the \(\lambda\) value with minimum cross-validated error, or a numeric value \(>0\) may be specified, with higher values yielding a sparser ensemble. To evaluate the trade-off between accuracy and sparsity of the final ensemble, inspect pre_object$glmnet.fit and plot(pre_object$glmnet.fit).

verbose

logical. should progress be printed to the command line?

Value

A list of length nsamp with null interaction models, to be used as input for interact.

Details

Note that computation of bootstrapped null interaction models is computationally intensive. The default number of samples is set to 10, but for reliable results argument nsamp should be set to a higher value (e.g., \(\ge 100\)).

See also section 8.3 of Friedman & Popescu (2008).

References

Fokkema, M. (2018). Fitting prediction rule ensembles with R package pre. https://arxiv.org/abs/1707.07149.

Friedman, J. H., & Popescu, B. E. (2008). Predictive learning via rule ensembles. The Annals of Applied Statistics, 2(3), 916-954.

See Also

pre, interact

Examples

Run this code
# NOT RUN {
set.seed(42)
airq.ens <- pre(Ozone ~ ., data=airquality[complete.cases(airquality),])
nullmods <- bsnullinteract(airq.ens)
interact(airq.ens, nullmods = nullmods, col = c("#7FBFF5", "#8CC876"))
# }

Run the code above in your browser using DataLab