var_select: Sequential Relevance of Box-defining Variables

Description Usage Arguments Details Value See Also Examples

Description

This function creates a table of the sequential relevance of the variables used in the definition of a box defined by define_fixbox.

Usage

1
var_select(fixbox)

Arguments

fixbox

object of class "fixbox" to be used to create the table of the sequential variable relevances.

Details

This function does a sequential removal off all variables defining one box. In each iteration every variable left in the box definition is tried to be completley left out of the definition. From all variables this one is removed, which causes the least decrease of the target function evaluated on all observations lying in the box.

Value

var_select returns a list with the following components:

tab

table showing the sequential relevances of the variables used in the definition of the fixbox.

fixboxes

list of the boxes defined at every iteration step (by removing of one variable).

See Also

define_fixbox, PRIM

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
# 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 box with a support of at least 0.1:
p <- PRIM(y~., data=dat, beta_min = 0.1, max_boxes = 1, print_position = FALSE)

# sequential variable relevances:
var_select(p$fixboxes[[1]])$tab

ao90/PRIM documentation built on May 5, 2019, 8:01 p.m.