Description
The PathSummarizer function takes output of the function
PathGenerator (td_path_generator_mle
) and returns,
for each prefix in the input tbl_teradata, the parent and children
and number of times each of its subsequences was traveled. This
output can be input to PathStart (td_path_start_mle
) function.
Usage
td_path_summarizer_mle (
object = NULL,
object.partition.column = NULL,
seq.column = NULL,
partition.names = NULL,
count.column = NULL,
delimiter = ",",
hash = FALSE,
prefix.column = NULL,
object.order.column = NULL,
object.sequence.column = NULL
)
Arguments
object |
Required Argument. |
object.partition.column |
Required Argument. |
object.order.column |
Optional Argument. |
count.column |
Optional Argument. |
delimiter |
Optional Argument. |
seq.column |
Required Argument. |
partition.names |
Required Argument. |
hash |
Optional Argument. |
prefix.column |
Required Argument. |
object.sequence.column |
Optional Argument. |
Value
Function returns an object of class "td_path_summarizer_mle" which is
a named list containing object of class "tbl_teradata".
Named list member can be referenced directly with the "$" operator
using the name: result.
Examples
# Get the current context/connection
con <- td_get_context()$connection
# Load example data.
loadExampleData("pathgenerator_example", "clickstream1")
# Create remote tibble objects.
# The table contains clickstream data, where the "path" column
# contains symbols for the pages that the customer clicked.
clickstream1 <- tbl(con, "clickstream1")
# Example 1 - td_path_summarizer_mle() uses the output of td_path_generator_mle().
td_path_generator_out <- td_path_generator_mle(data = clickstream1,
seq.column = "path"
)
td_path_summarizer_out1 <- td_path_summarizer_mle(object = td_path_generator_out,
object.partition.column = c('prefix'),
seq.column = 'sequence',
partition.names = 'prefix',
prefix.column = 'prefix'
)
# Example 2 - Alternatively, persist and use the output table of td_path_generator_mle().
generated_path_table <- td_path_generator_out %>% extract2(1) %>% copy_to(con, df = .)
td_path_summarizer_out2 <- td_path_summarizer_mle(object = generated_path_table,
object.partition.column = c('prefix'),
seq.column = 'sequence',
partition.names = 'prefix',
prefix.column = 'prefix'
)