Description Usage Arguments Details Value References See Also Examples
This function is a automated implementation of PRIM as suggested by Friedman and Fisher (1999).
It includes multiple peeling (PRIM_peel_bs
), pasting (PRIM_paste
) and the covering stretegy to find more than one box.
1 2 3 4 |
formula |
an object of class " |
data |
an object of class |
f_min |
minimum target the final box must have. From all boxes, that fulfill this criterion, the one with the biggest support is taken after the peeling. If this argument is missing the box with the biggest target having at least a support of |
beta_min |
minimum support that one box must have. This proportion always refers to the whole data set. |
max_boxes |
maximum number of boxes to be found. |
peel_alpha |
vector of a sequence of different alpha-fractions used for the peelings. |
B |
number of bootstrap samples on which the peeling is applied to for each alpha. For |
target |
target-function to be maximized. In most cases the mean is a useful target, although other functions like e.g. the median are also possible here. |
alter_crit |
logical. If |
use_NAs |
logical. If |
seed |
seed to be set before the first iteration. Only useful for |
print_position |
logical. If |
paste_alpha |
alpha-fraction that is pasted to the box at each pasting step |
max_steps |
maximum number of pasting steps the function should make. |
stop_by_dec |
logical. If |
This function repeats the peeling and pasting algorithm for the same settings of the metaparameters until a stop ctiterion is reached.
After each iteration the observations already included in a box are removed from the data, on which the next box is built. This strategy is called covering.
This iteration stops if either max_boxes
is reached or if the target function of the "best" box is lower than the overall target.
In each iteration step this function does a multiple peeling characterized by the sequenz alpha_peel
and B
.
From the peeling output the box defined by beta_min
and f_min
is chosen.
After that the pasting function seeks for boxes with bigger supports and bigger targets and takes the one with the highest target function within the box.
The function can also cope with survival outcomes (Surv
-object). Therefore the hazard rate is used as target function as suggested in Ott and Hapfelmeier (2017). The value of the input parameter target
is ignored in this case.
PRIM
returns an object of class "prim
", which is a list containing the following components:
f |
vector of the target functions evaluated on each box. The last element is the target of all observations not lying in a box. |
beta |
vector of the supports of each box. The last element is the fraction of observations not lying in a box. |
box |
a For the nominal variables there are columns for every category they can take. If the category is removed from the box the value For each variable with missing values (only if |
box_metric, box_nom, box_na |
easier to handle definitions of the boxes for other functions |
subsets |
|
fixboxes |
|
data_orig |
original dataset that is used. |
Friedman, J. H. and Fisher, N. I., 'Bump hunting in high-dimensional data', Statistics and Computing 9 (2) (1999), 123-143
Ott, A. and Hapfelmeier, A., 'Nonparametric Subgroup Identification by PRIM and CART: A Simulation and Application Study', Computational and Mathematical Methods in Medicine, vol. 2017 (2017), 17 pages, Article ID 5271091
PRIM_peel_bs
, PRIM_paste
, define_fixbox
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | # generating random data:
set.seed(123)
n <- 500
x1 <- runif(n = n, min = -1)
x2 <- runif(n = n, min = -1)
x3 <- runif(n = n, min = -1)
cat <- as.factor(sample(c("a","b","c", "d"), size = n, replace = TRUE))
wsk <- (1-sqrt(x1^2+x2^2)/sqrt(2))
y <- as.logical(rbinom(n = n, prob = wsk, size = 1))
dat <- cbind.data.frame(y, x1, x2, x3, cat)
#plot(dat$x1, dat$x2, col=dat$y+1, pch=16)
remove(x1, x2, x3, y, wsk, cat, n)
# apply the PRIM function to find the best boxes with a support of at least 0.1:
p <- PRIM(y~., data=dat, beta_min = 0.1, max_boxes = 3)
p
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.