| pat_eclat | R Documentation |
Frequent itemsets using arules::eclat.
pat_eclat(
supp = 0.5,
minlen = 1,
maxlen = 3,
include = NULL,
exclude = NULL,
quality_filter = NULL,
control = NULL
)
supp |
minimum support threshold |
minlen |
minimum itemset length |
maxlen |
maximum itemset length |
include |
optional vector of items allowed in the discovered itemsets |
exclude |
optional vector of items forbidden in the discovered itemsets |
quality_filter |
optional quality filter created with |
control |
list of control parameters |
returns a pat_eclat object
if (requireNamespace("arules", quietly = TRUE)) {
data("AdultUCI", package = "arules")
trans <- suppressWarnings(methods::as(as.data.frame(AdultUCI), "transactions"))
utils <- patutils()
pm <- pat_eclat(
supp = 0.2,
maxlen = 3,
include = c("sex=Male", "income=small", "marital-status=Married-civ-spouse", "race=White"),
exclude = c("income=small"),
quality_filter = utils$quality_min(support = 0.4),
control = list(verbose = FALSE)
)
pm <- fit(pm, trans)
itemsets <- discover(pm, trans)
eval <- evaluate(pm, itemsets)
eval$metrics
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.