Description Usage Arguments Value See Also Examples
For each observation in newx, check if it is in selected boxes of
object. Also gives the objective function values of each box
based on the newy values.
1 2 3 4 5 6 7 8 9 10 11 |
object |
A |
newx |
A data.frame of new input values. If missing, uses
|
newy |
A vector of new responses values corresponding to the
inputs in |
npeel |
Integer vector indicating which boxes in |
support |
Numeric vector with values between 0 and 1 indicating the
support of boxes in |
yfun |
Numeric vector indicating the value of the objective function
for the boxes in |
npaste |
Integer vector indicating which boxes in |
... |
further arguments passed to or from other methods. |
A list with elements:
inbox |
A logical matrix of dimension n x nboxes where n is the
number of observations in |
support |
A numeric vector giving, for each box, the proportion
of observations in |
yfun |
A numeric vector giving, for each box, the objective function
value computed on |
peeling and pasting for creating prim
objects.
1 2 3 4 5 6 7 8 | 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)
# Prediction
predict(peel_res, newx = data.frame(x1 = 1:10/11, x2 = 1:10/11),
newy = 1:10, support = c(1, 0.25))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.