rcbaModel2CBARuleModel {qCBA} | R Documentation |
rcbaModel2arcCBARuleModel Converts a model created by rCBA so that it can be passed to qCBA
Description
Creates instance of CBAmodel class from the arc package Instance of CBAmodel can then be passed to qcba
Usage
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 |
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
# 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)
}
}
[Package qCBA version 0.5.1 Index]