build: Build classifier function (Apriori-based)

Description Usage Arguments Value Examples

View source: R/build.R

Description

Automatic build of the classification model using the Apriori algorithm from the arules

Usage

1
2
build(trainData, className = NA, pruning = TRUE, sa = list(),
  verbose = TRUE, parallel = TRUE)

Arguments

trainData

data.frame or transactions from arules with input data

className

column name with the target class - default is the last column

pruning

performing pruning while building the model

sa

simulated annealing setting. Default values: list(temp=100.0, alpha=0.05, tabuRuleLength=5, timeout=10)

verbose

verbose indicator

parallel

parallel indicator

Value

list with parameters and model as data.frame with rules

Examples

1
2
3
4
5
6
7
8
9
library("rCBA")
data("iris")

output <- rCBA::build(iris,sa = list(alpha=0.5), parallel=FALSE) # speeding up the cooling
model <- output$model

predictions <- rCBA::classification(iris, model)
table(predictions)
sum(as.character(iris$Species)==as.character(predictions), na.rm=TRUE) / length(predictions)

rCBA documentation built on May 30, 2019, 1:01 a.m.

Related to build in rCBA...