predict.apriori {fdm2id}R 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])

[Package fdm2id version 0.9.9 Index]