Learn R Programming

subgroup.discovery (version 0.3.1)

predict.prim.peel: Validate peels

Description

Validate the results taken from the PRIM peeling process

Usage

# S3 method for prim.peel
predict(object, newdata, ...)

Arguments

object

An S3 object of class prim.peel

newdata

A data frame in which to look for variables with which to predict

...

further arguments passed to or from other methods

Value

An S3 object of type prim.predict

Details

This function takes the result of the prim peeling process and applies it to new data. Usually the optimal box in the peeling process is not the best on unobserved data.

Examples

Run this code
# NOT RUN {
  data(ames)
  ames.sample <- sample(nrow(ames), nrow(ames) * 0.75)
  ames <- prim.data.prepare(ames)
  ames.model <- prim(SalePrice ~ . - PID - Order, ames[ames.sample,])
  ames.predict <- predict(ames.model, ames[-ames.sample,])
  plot(ames.model)
  plot(ames.predict)
# }

Run the code above in your browser using DataLab