tests/similarity.R

library("arulesSequences")

### ceeboo 2008, 2016

data(zaki)

z <- as(zaki, "timedsequences")
as(as(z, "sequences"), "data.frame")

s <- similarity(z)
s
all(s == similarity(z, z))

as(s, "dist")

similarity(z, strict = TRUE) - s

similarity(z, method = "dice") - s
similarity(z, method = "cosine") - s

similarity(z, method = "subset", strict = TRUE)
similarity(z, method = "subset")

is.subset(z)
is.subset(z, proper = TRUE)

is.subset(z[3], z)
is.subset(z[3], z, proper = TRUE)

is.superset(z)

is.superset(z[1], z)

###

Try the arulesSequences package in your browser

Any scripts or data that you put into this service are public.

arulesSequences documentation built on July 29, 2018, 5:02 p.m.