# NOT RUN {
# CS data, d.educate
cco1 <- conCovOpt(d.educate)
best1 <- selectMax(cco1)
reprodAssign(best1, outcome = "E")
DNFbuild(best1, outcome = "E")
DNFbuild(best1, outcome = "E", reduce = FALSE) # canonical DNF
DNFbuild(best1, outcome = "E", reduce = "ereduce") # all redundancy-free DNFs
DNFbuild(best1, outcome = "E", reduce = "rreduce") # one redundancy-free DNF
DNFbuild(best1, outcome = "E", reduce = "none") # canonical DNF
# Simulated mv data
datMV <- data.frame(
A = c(3,2,1,1,2,3,2,2,2,1,1,2,3,2,2,2,1,2,3,3,3,1,1,1,3,1,2,1,2,3,3,2,2,2,1,2,2,3,2,1,2,1,3,3),
B = c(1,2,3,2,1,1,2,1,2,2,3,1,1,1,2,3,1,3,3,3,1,1,3,2,2,1,1,3,3,2,3,1,2,1,2,2,1,1,2,2,3,3,3,3),
C = c(1,3,3,3,1,1,1,2,2,3,3,1,1,2,2,2,3,1,1,2,1,2,2,3,3,1,2,2,2,3,2,1,1,2,2,2,1,1,1,2,2,1,1,2),
D = c(3,1,2,2,1,1,1,1,1,1,1,2,2,2,2,2,2,3,3,3,1,1,1,1,1,2,2,2,2,2,3,1,1,1,1,1,2,2,2,2,2,3,3,3),
E = c(3,2,2,3,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3,3,3,3)
)
# Apply conCovOpt and selectMax.
cco2 <- conCovOpt(mvtt(datMV))
best2 <- selectMax(cco2)
# Apply DNFbuild to build one redundancy-free DNF reaching best2.
(formula1 <- DNFbuild(best2, outcome = "D=3"))
# formula1 reaches the con-cov score stored in best2 for outcome "D=3".
condTbl(paste0(formula1, "<-> D=3"), mvtt(datMV))
# Build all redundancy-free DNFs reaching best2.
DNFbuild(best2, outcome = "D=3", reduce = "ereduce")
# Any factor value in datMV can be treated as outcome.
(formula2 <- DNFbuild(best2, outcome = "E=3"))
condTbl(paste0(formula2, "<-> E=3"), mvtt(datMV))
# Any con-cov optimum in cco2 can be targeted via its identifier.
(formula3 <- DNFbuild(best2, outcome = "E=3", id = 508))
condTbl(paste0(formula3, "<-> E=3"), mvtt(datMV))
# Simulated fs data
datFS <- data.frame(
A = c(.73, .85, .94, .36, .73, .79, .39, .82, .15, .12, .67, .27, .3),
B = c(.21, .03, .91, .64, .39, .12, .06, .7, .73, .15, .88, .73, .36),
C = c(.61, 0, .61, 1, .94, .15, .88, .27, .12, .12, .27, .15, .15),
D = c(.64, .67, .3, .06, .33, .03, .76, .94, .67, .76, .18, .27, .36),
E = c(.91, .94, .67, .85, .73, .79, .24, .09, .03, .21, .33, .36, .27)
)
# Apply conCovOpt and selectMax.
cco3 <- conCovOpt(datFS, outcome = "E", type = "fs", allConCov = TRUE)
best3 <- selectMax(cco3)
# Apply reprodAssign.
reprodAssign(best3, outcome = "E")
# Select a con-cov optimum in cco3 via its identifier.
reprodAssign(best3, outcome = "E", id = 252)
# DNFbuild does not work for fs data; it generates an error.
try(DNFbuild(best3, outcome = "E"))
# }
Run the code above in your browser using DataCamp Workspace