Description Usage Arguments Examples
Creates instance of CBAmodel class from the arc package Instance of CBAmodel can then be passed to qcba
1 | rcbaModel2CBARuleModel(rcbaModel, cutPoints, classAtt, rawDataset, attTypes)
|
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. |
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)
}
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.