transform.LatentDirichletAllocation.RdSimilar to other predict methods, this function predicts fitted values from a fitted "LatentDirichletAllocation" object.
# S3 method for LatentDirichletAllocation transform( model, data, key, document = NULL, burn.in = NULL, iteration = NULL, thin = NULL, seed = NULL, gibbs.init = NULL, delimiters = NULL, output.word.assignment = NULL )
| model |
|
|---|---|
| data |
|
| key |
|
| document |
|
| burn.in |
|
| iteration |
|
| thin |
|
| seed |
Defaults to 0. |
| gibbs.init |
Defaults to 'uniform'. |
| delimiters |
|
| output.word.assignment |
|
Predicted values are returned as a list of DataFrames, structured as follows:
Document ID column: with same name and type as data's
document ID column.
TOPIC_ID: type INTEGER, topic ID.
PROBABILITY: type DOUBLE, probability of topic given document.
Document ID column:with same name and type as data's
document ID column.
WORD_ID:type INTEGER, word ID.
TOPIC_ID: type INTEGER, topic ID.
STAT_NAME: type NVARCHAR(256), statistic name.
STAT_VALUE: type NVARCHAR(1000), statistic value.
Perform the predict on DataFrame data1 using "LatentDirichletAllocation" object LDA:
> data1$Collect()
DOCUMENT_ID TEXT
1 10 toy toy spoon cpu
> result <- transform(LDA, pred.data, key = "DOCUMENT_ID",
document = "TEXT", burn.in = 2000,
iteration = 1000, thin = 100,
seed = 1, output.word.assignment = TRUE)
Output:
> result[[1]]$Collect()
DOCUMENT_ID TOPIC_ID PROBABILITY
1 10 0 0.23913043478260873
2 10 1 0.4565217391304348
3 10 2 0.02173913043478261
4 10 3 0.02173913043478261
5 10 4 0.23913043478260873
6 10 5 0.02173913043478261