Learn R Programming

fdm2id (version 0.9.6)

predict.apriori: Model predictions

Description

This function predicts values based upon a model trained by apriori.classif. Observations that do not match any of the rules are labelled as "unmatched".

Usage

# S3 method for apriori
predict(object, test, unmatched = "Unknown", ...)

Value

A vector of predicted values (factor).

Arguments

object

The classification model (of class apriori, created by apriori.classif).

test

The test set (a data.frame)

unmatched

The class label given to the unmatched observations (a character string).

...

Other parameters.

See Also

APRIORI, apriori-class, apriori

Examples

Run this code
require ("datasets")
data (iris)
d = discretizeDF (iris,
    default = list (method = "interval", breaks = 3, labels = c ("small", "medium", "large")))
model = APRIORI (d [, -5], d [, 5], supp = .1, conf = .9, prune = TRUE)
predict (model, d [, -5])

Run the code above in your browser using DataLab