fim4r {arules} | R Documentation |
Interfaces the algorithms implemented in fim4r. The algorithms include: Apriori, Eclat, FPgrowth, Carpenter, IsTa, RElim and SaM.
fim4r(
transactions,
method = NULL,
target = "frequent",
report = NULL,
appear = NULL,
...
)
transactions |
a transactions object |
method |
the algorithm to be used. One of:
|
target |
the target type. One of: |
report |
cannot be used via the interface. |
appear |
Specify item appearance in rules (only for apriori, eclat, fpgrowth
and the target
|
... |
further arguments are passed on to the |
Installation:
The package fim4r is not available via CRAN. If needed,
the fim4r()
function downloads and installs the package automatically.
Additional Notes:
Support and confidence (parameters supp
and conf
) are specified
in the range [0, 100]
.
Type ? fim4r::fim4r
for help on additional available arguments. This is only available
after package fim4r
is installed.
Algorithm descriptions and references can be found on the web page in the References Section.
An object of class itemsets or rules.
Christian Borgelt, fimi4r: Frequent Item Set Mining and Association Rule Induction for R. https://borgelt.net/fim4r.html
Other mining algorithms:
APappearance-class
,
AScontrol-classes
,
ASparameter-classes
,
apriori()
,
eclat()
,
ruleInduction()
,
weclat()
## Not run:
data(Adult)
# list available algorithms
fim4r()
# mine association rules with FPgrowth
# note that fim4r specifies support and confidence out of 100%
r <- fim4r(Adult, method = "fpgrowth", target = "rules", supp = 70, conf = 80)
r
inspect(head(r, by = "lift"))
# mine closed itemsets with Carpenter or IsTa
closed <- fim4r(Adult, method = "carpenter", target = "closed", supp = 70)
closed
fim4r(Adult, method = "ista", target = "closed", supp = 70)
# mine frequent itemset of length 2 (zmin and zmax = 2)
freq_2 <- fim4r(Adult, method = "relim", target = "frequent", supp = 70,
zmin = 2, zmax = 2)
inspect(freq_2)
# mine maximal frequent itemsets
mfis <- fim4r(Adult, method = "sam", target = "maximal", supp = 70)
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 = 90, conf = 90, zmin = 2)
inspect(rules_all)
rules_no_gain <- fim4r(Adult, method = "fpgrowth", target = "rules",
supp = 90, conf = 90, zmin = 2,
appear = list(c("capital-gain=None"), c("-"))
)
inspect(rules_no_gain)
## End(Not run)