Description
The HMMSupervisedLearner (td_hmm_supervised_mle
) function is available on SQL-Graph platform.
The function can produce multiple HMM models simultaneously, where
each model is learned from a set of sequences and where each sequence
represents a vertex.
Usage
td_hmm_supervised_mle ( vertices = NULL, model.key = NULL, sequence.key = NULL, observed.key = NULL, state.key = NULL, skip.key = NULL, batch.size = NULL, vertices.sequence.column = NULL, vertices.partition.column = NULL, vertices.order.column = NULL )
Arguments
vertices |
Required Argument. |
vertices.partition.column |
Specifies the Partition By columns for "vertices". |
vertices.order.column |
Specifies the Order By columns for "vertices". |
model.key |
Required Argument. |
sequence.key |
Required Argument. |
observed.key |
Required Argument. |
state.key |
Required Argument. |
skip.key |
Optional Argument. |
batch.size |
Optional Argument. |
vertices.sequence.column |
Optional Argument. |
Value
Function returns an object of class "td_hmm_supervised_mle" which is a named list containing Teradata tbl objects. Named list members can be referenced directly with the "$" operator using following names:
output.initialstate.table
-
output.statetransition.table
output.emission.table
output
Examples
# Get the current context/connection con <- td_get_context()$connection # Load example data. loadExampleData("hmmsupervised_example", "customer_loyalty") # Create remote tibble objects. customer_loyalty <- tbl(con, "customer_loyalty") # Example 1 - Train a HMM Supervised model on the customer loyalty dataset td_hmm_supervised_out <- td_hmm_supervised_mle(vertices = customer_loyalty, vertices.partition.column = c("user_id", "seq_id "), vertices.order.column = c("user_id", "seq_id", "purchase_date"), model.key = "user_id", sequence.key = "seq_id", observed.key = "observation", state.key = "loyalty_level" )