Description Usage Arguments Details Value See Also Examples
Extracts one or several boxes from a prim
object.
1 | extract.box(object, npeel = NULL, support = NULL, yfun = NULL, npaste = NULL)
|
object |
|
npeel |
Integer vector indicating which boxes to choose in |
support |
Numeric vector with values between 0 and 1 indicating the
support of boxes to choose in |
yfun |
Numeric vector indicating the value of the objective function
for the chosen boxes in |
npaste |
Integer vector indicating which boxes to choose in
|
Returns one or several boxes from object
. The boxes can be
given through the number of peeling iterations (argument npeel
),
pasting iterations (argument npaste
), closest support
(argument support
) or closest objective function value
(argument yfun
). Note that several of these arguments can be
used at once to return several boxes. If no box matches the arguments
or if they are all NULL
, the last box in object
is
returned.
A list with elements:
limits |
A list giving the limits of extracted boxes. Each limit is a list with one element per input variable. |
npeel |
A vector giving the number of peeling iterations leading to each extracted box. |
yfun |
A vector giving the objective function value of each extracted box. |
support |
A vector giving the support of each extracted box. |
peeling
to perform the peeling and create a prim
object.
1 2 3 4 5 6 7 8 9 10 | # A simple bump
set.seed(12345)
x <- matrix(runif(2000), ncol = 2, dimnames = list(NULL, c("x1", "x2")))
y <- 2 * x[,1] + 5 * x[,2] + 10 * (x[,1] >= .8 & x[,2] >= .5) + rnorm(1000)
# Peeling step
peel_res <- peeling(y, x)
# Extracting a single box
single_box <- extract.box(peel_res, support = 0.1)
# Extracting all boxes from a prim object
all_boxes <- extract.box(peel_res, npeel = 0:peel_res$npeel)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.