classification {rCBA} | R Documentation |
A classification function
Description
A classification function
Usage
classification(test, rules, verbose = TRUE)
Arguments
test |
|
rules |
|
verbose |
verbose indicator |
Value
vector with classifications
Examples
library("arules")
library("rCBA")
data("iris")
train <- sapply(iris, as.factor)
train <- data.frame(train, check.names=FALSE)
txns <- as(train,"transactions")
rules = apriori(txns, parameter=list(support=0.03, confidence=0.03, minlen=2),
appearance = list(rhs=c("Species=setosa", "Species=versicolor", "Species=virginica"),default="lhs"))
predictions <- rCBA::classification(train,rules)
table(predictions)
sum(as.character(train$Species)==as.character(predictions),na.rm=TRUE)/length(predictions)
[Package rCBA version 0.4.3 Index]