Skip to contents

This function returns a trimmed context tree from which match positions have been removed.

Usage

trim(ct, ...)

Arguments

ct

a context tree.

...

additional arguments for the trim function.

Value

a trimmed context tree.

Examples

## context tree trimming
dts <- sample(as.factor(c("A", "B", "C")), 1000, replace = TRUE)
dts_tree <- ctx_tree(dts, max_depth = 10, min_size = 5, keep_position = TRUE)
print(object.size(dts_tree))
#> 156640 bytes
dts_tree <- trim(dts_tree)
print(object.size(dts_tree))
#> 106280 bytes