Learn R Programming

subgroup.discovery (version 0.3.1)

prim.box.index: Prim Box Index

Description

For a given box (defined as a set of peels) id, return the index of those rows that satisfy all conditions of the box

Usage

prim.box.index(object, newdata, box.index)

Arguments

object

An S3 object of class prim.peel or prim.predict

newdata

A data frame on which to apply the conditions

box.index

Optionally, the index of the peel which defines the box. If not provided, the simplest box with the highest quality is used

Value

A vector of indices

Examples

Run this code
# NOT RUN {
  data(pima)
  pima.sample <- sample(nrow(pima), 0.75*nrow(pima))
  pima <- prim.data.prepare(pima)
  pima.model <- prim(class ~ ., data = pima[pima.sample,],
    peeling.quantile = 0.4, min.support = 0.4)
  pima.predict <- predict(pima.model, pima[-pima.sample,])
  pima.idx <- prim.box.index(pima.predict, pima)
# }

Run the code above in your browser using DataLab