Description Usage Arguments Details Value References Examples
This function is an implementation of the (singular) Peeling-Algorithm as suggested by Friedman and Fisher (1999). In each iteration the fraction alpha is peeled from one edge of the current box.
1 2 |
formula |
an object of class " |
data |
an object of class |
peel_alpha |
alpha-fraction used for the peeling. |
beta_min |
minimum support that one Box should have (stop-criterion). |
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 |
The outcome of the formula
can either be numeric, logical or a survival object (see Surv
). If it is a survival object the target
is set to the number of events per amount of time.
This function is the main part of the multiple Version PRIM_peel_bs
.
PRIM_peel
returns an object of class "peel
", which is a list containing at least the following components:
f |
vector of the target functions evaluated on the box at each peeling step. |
beta |
vector of the supports beta of the boxes at each peeling step. |
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 |
|
data_orig |
original dataset that is used for the peeling. |
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
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | # 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_peel function:
prim <- PRIM_peel(formula=y ~ ., data=dat, beta_min = .01, peel_alpha = .1)
plot(prim) # trajectory
prim$box # box definitions
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.