|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjml.topics.TopicModel
public abstract class TopicModel
Abstract super class for all topic models.
Field Summary | |
---|---|
protected org.apache.commons.math.linear.RealMatrix |
dataMatrix
A V-by-N matrix with each column being a term-count array. |
protected org.apache.commons.math.linear.RealMatrix |
indicatorMatrix
A N-by-K matrix holding document--topic associations. |
int |
nTopic
Number of topics. |
protected org.apache.commons.math.linear.RealMatrix |
topicMatrix
A V-by-K matrix, where each column is a topic vector represented by a vector of weights. |
Constructor Summary | |
---|---|
TopicModel()
Default constructor for this topic model. |
|
TopicModel(int nTopic)
Constructor for this topic model given the number of topics for a corpus. |
Method Summary | |
---|---|
org.apache.commons.math.linear.RealMatrix |
getIndicatorMatrix()
Get the N-by-K topic assignment matrix for this topic model. |
org.apache.commons.math.linear.RealMatrix |
getTopicMatrix()
Get the V-by-K topic matrix for this topic model. |
void |
readCorpus(org.apache.commons.math.linear.RealMatrix dataMatrix)
Read corpus from a V-by-N document-term-count matrix for this topic model. |
abstract void |
train()
Train this topic model to fit the given corpus. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected org.apache.commons.math.linear.RealMatrix dataMatrix
protected org.apache.commons.math.linear.RealMatrix topicMatrix
protected org.apache.commons.math.linear.RealMatrix indicatorMatrix
public int nTopic
Constructor Detail |
---|
public TopicModel()
public TopicModel(int nTopic)
nTopic
- number of topics to fit a corpusMethod Detail |
---|
public void readCorpus(org.apache.commons.math.linear.RealMatrix dataMatrix)
dataMatrix
- a V-by-N document-term-count matrixpublic org.apache.commons.math.linear.RealMatrix getTopicMatrix()
public org.apache.commons.math.linear.RealMatrix getIndicatorMatrix()
public abstract void train()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |