Description
The SentimentTrainer function trains a model; that is, takes training documents and outputs a maximum entropy classification model, which it installs on ML Engine. For information about maximum entropy, see https://en.wikipedia.org/wiki/Maximum_entropy method.
Usage
td_sentiment_trainer_mle ( data = NULL, text.column = NULL, sentiment.column = NULL, language = "en", model.file = NULL, data.sequence.column = NULL )
Arguments
data |
Required Argument. |
text.column |
Required Argument. |
sentiment.column |
Required Argument. |
language |
Optional Argument. |
model.file |
Required Argument. |
data.sequence.column |
Optional Argument. |
Value
Function returns an object of class "td_sentiment_trainer_mle" which is a named list containing Teradata tbl object. Named list member can be referenced directly with the "$" operator using name: output.
Examples
# Get the current context/connection con <- td_get_context()$connection # Load example data. loadExampleData("sentimenttrainer_example", "sentiment_train") # The sample dataset contains collection of user reviews for different products. sentiment_train <- tbl(con, "sentiment_train") # Example 1 - Build a model and output a maximum entropy classification # model to a binary file td_sentiment_trainer_out <- td_sentiment_trainer_mle(data = sentiment_train, text.column = "review", sentiment.column = "category", model.file = "sentimentmodel1.bin" )