Package cc.mallet.topics
Class DMRInferencer
- java.lang.Object
-
- cc.mallet.topics.TopicInferencer
-
- cc.mallet.topics.DMRInferencer
-
- All Implemented Interfaces:
java.io.Serializable
public class DMRInferencer extends TopicInferencer implements java.io.Serializable
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected int
defaultFeatureIndex
protected MaxEnt
dmrParameters
protected int
numFeatures
-
Fields inherited from class cc.mallet.topics.TopicInferencer
alpha, alphabet, beta, betaSum, cachedCoefficients, numTopics, numTypes, random, smoothingOnlyMass, tokensPerTopic, topicBits, topicMask, typeTopicCounts
-
-
Constructor Summary
Constructors Constructor Description DMRInferencer(int[][] typeTopicCounts, int[] tokensPerTopic, MaxEnt dmrParameters, Alphabet alphabet, double beta, double betaSum)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description double[]
getSampledDistribution(Instance instance, int numIterations, int thinning, int burnIn)
Use Gibbs sampling to infer a topic distribution.static DMRInferencer
read(java.io.File f)
-
Methods inherited from class cc.mallet.topics.TopicInferencer
setRandomSeed, writeInferredDistributions
-
-
-
-
Field Detail
-
dmrParameters
protected MaxEnt dmrParameters
-
numFeatures
protected int numFeatures
-
defaultFeatureIndex
protected int defaultFeatureIndex
-
-
Method Detail
-
getSampledDistribution
public double[] getSampledDistribution(Instance instance, int numIterations, int thinning, int burnIn)
Description copied from class:TopicInferencer
Use Gibbs sampling to infer a topic distribution. Topics are initialized to the (or a) most probable topic for each token. Using zero iterations returns exactly this initial topic distribution. This code does not adjust type-topic counts: P(w|t) is clamped.- Overrides:
getSampledDistribution
in classTopicInferencer
-
read
public static DMRInferencer read(java.io.File f) throws java.lang.Exception
- Throws:
java.lang.Exception
-
-