rcbaModel2CBARuleModel: rcbaModel2arcCBARuleModel Converts a model created by 'rCBA'...

Description Usage Arguments Examples

View source: R/rMARC.R

Description

Creates instance of CBAmodel class from the arc package Instance of CBAmodel can then be passed to qcba

Usage

1
rcbaModel2CBARuleModel(rcbaModel, cutPoints, classAtt, rawDataset, attTypes)

Arguments

rcbaModel

object returned by rCBA::build

cutPoints

specification of cutpoints applied on the data before they were passed to rCBA::build

classAtt

the name of the class attribute

rawDataset

the raw data (before discretization). This dataset is used to guess attribute types if attTypes is not passed

attTypes

vector of attribute types of the original data. If set to null, you need to pass rawDataset.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
# this example takes about 10 seconds
if (! requireNamespace("rCBA", quietly = TRUE)) {
 message("Please install rCBA: install.packages('rCBA')")
} else
{
# This will run only outside a CRAN test, if the environment variable  NOT_CRAN is set to true
# This environment variable is set by devtools
if (identical(Sys.getenv("NOT_CRAN"), "true")) {
 library(rCBA)
 message(packageVersion("rCBA"))
 discrModel <- discrNumeric(iris, "Species")
 irisDisc <- as.data.frame(lapply(discrModel$Disc.data, as.factor))
 rCBAmodel <- rCBA::build(irisDisc,parallel=FALSE, sa=list(timeout=0.01))
 CBAmodel <- rcbaModel2CBARuleModel(rCBAmodel,discrModel$cutp,"Species",iris)
 qCBAmodel <- qcba(CBAmodel,iris)
 print(qCBAmodel@rules)
 }
}

qCBA documentation built on Nov. 19, 2020, 9:07 a.m.