if (FALSE) {
data(Adult)
# list available algorithms
fim4r()
# mine association rules with FPgrowth
r <- fim4r(Adult, method = "fpgrowth", target = "rules", supp = .7, conf = .8)
r
inspect(head(r, by = "lift"))
# mine closed itemsets with Carpenter or IsTa
closed <- fim4r(Adult, method = "carpenter", target = "closed", supp = .7)
closed
fim4r(Adult, method = "ista", target = "closed", supp = .7)
# mine frequent itemset of length 2 (zmin and zmax = 2)
freq_2 <- fim4r(Adult, method = "relim", target = "frequent", supp = .7,
zmin = 2, zmax = 2)
inspect(freq_2)
# mine maximal frequent itemsets
mfis <- fim4r(Adult, method = "sam", target = "maximal", supp = .7)
inspect(mfis)
# use item appearance. We first mine all rules and then restrict
# the appearance of the item capital-gain=None
rules_all <- fim4r(Adult, method = "fpgrowth", target = "rules",
supp = .9, conf = .9, zmin = 2)
inspect(rules_all)
rules_no_gain <- fim4r(Adult, method = "fpgrowth", target = "rules",
supp = .9, conf = .9, zmin = 2,
appear = list(c("capital-gain=None"), c("-"))
)
inspect(rules_no_gain)
}
Run the code above in your browser using DataLab