| pat_cspade | R Documentation |
Sequential pattern mining using arulesSequences::cspade.
pat_cspade(
support = 0.4,
maxsize = NULL,
maxlen = NULL,
mingap = NULL,
maxgap = NULL,
quality_filter = NULL,
control = list(verbose = TRUE)
)
support |
minimum support threshold |
maxsize |
maximum number of items per event |
maxlen |
maximum number of events per sequence |
mingap |
minimum gap between successive events |
maxgap |
maximum gap between successive events |
quality_filter |
optional quality filter created with |
control |
list of control parameters |
returns a pat_cspade object
if (requireNamespace("arulesSequences", quietly = TRUE)) {
x <- arulesSequences::read_baskets(
con = system.file("misc", "zaki.txt", package = "arulesSequences"),
info = c("sequenceID", "eventID", "SIZE")
)
utils <- patutils()
pm <- pat_cspade(
support = 0.4,
maxlen = 3,
quality_filter = utils$quality_min(support = 0.5)
)
pm <- fit(pm, x)
seqs <- discover(pm, x)
eval <- evaluate(pm, seqs)
eval$metrics
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.