predict.apriori: Model predictions

predict.aprioriR Documentation

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 class 'apriori'
predict(object, test, unmatched = "Unknown", ...)

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.

Value

A vector of predicted values (factor).

See Also

APRIORI, apriori-class, apriori

Examples

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])

fdm2id documentation built on July 9, 2023, 6:05 p.m.