Description
The LDATopicSummary function displays readable information
from the binary model tbl_teradata generated by the Latent Dirichlet Allocation i.e.,
LDATrainer (td_lda_mle
) function.
Usage
td_lda_topic_summary_mle (
object = NULL,
summary = FALSE,
out.topicwordnum = "all",
word.weight = FALSE,
word.count = FALSE,
out.byword = TRUE,
object.sequence.column = NULL,
object.order.column = NULL
)
Arguments
object |
Required Argument. |
object.order.column |
Optional Argument. |
summary |
Optional Argument. |
out.topicwordnum |
Optional Argument. |
word.weight |
Optional Argument. |
word.count |
Optional Argument. |
out.byword |
Optional Argument. |
object.sequence.column |
Optional Argument. |
Value
Function returns an object of class "td_lda_topic_summary_mle" which
is a named list containing object of class "tbl_teradata".
Named list member can be referenced directly with the "$" operator
using name: result.
Examples
# Get the current context/connection
con <- td_get_context()$connection
# Load example data.
loadExampleData("lda_example","complaints_traintoken")
# Create object(s) of class "tbl_teradata".
complaints_traintoken <- tbl(con, "complaints_traintoken")
# Example 1 - This example uses the model tbl_teradata generated by td_lda_mle() function
# to display only a summary of the information in the model.
td_lda_out <- td_lda_mle(data=complaints_traintoken,
docid.column='doc_id',
word.column='token',
topic.num=3,
alpha=0.1,
eta=0.1,
maxiter=50,
convergence.delta=0.0001,
seed=2,
out.topicnum='all',
out.topicwordnum='none'
)
td_lda_topic_summary_mle_out <- td_lda_topic_summary_mle(object = td_lda_out,
summary = TRUE)
# Example 2 - This example displays all topic words and their topic identifiers
# with each row contains a unique topic and all words that occur in that topic,
# separated by commas.
td_lda_topic_summary_mle_out <- td_lda_topic_summary_mle(object = td_lda_out,
out.topicwordnum = 'all',
out.byword = TRUE
)
# Example 3 - This example displays each topic-word pair with wordweight, wordcount,
# each topic-word pair in its own row.
td_lda_topic_summary_mle_out <- td_lda_topic_summary_mle(object = td_lda_out,
word.weight = TRUE,
word.count = TRUE,
out.byword = TRUE
)