cc.mallet.topics
Class MarginalProbEstimator

java.lang.Object
  extended by cc.mallet.topics.MarginalProbEstimator
All Implemented Interfaces:
java.io.Serializable

public class MarginalProbEstimator
extends java.lang.Object
implements java.io.Serializable

An implementation of topic model marginal probability estimators presented in Wallach et al., "Evaluation Methods for Topic Models", ICML (2009)

Author:
David Mimno
See Also:
Serialized Form

Field Summary
protected  double[] alpha
           
protected  double alphaSum
           
protected  double beta
           
protected  double betaSum
           
protected  double[] cachedCoefficients
           
protected  int numTopics
           
protected  Randoms random
           
protected  double smoothingOnlyMass
           
protected  int[] tokensPerTopic
           
protected  int topicBits
           
protected  int topicMask
           
protected  int[][] typeTopicCounts
           
 
Constructor Summary
MarginalProbEstimator(int numTopics, double[] alpha, double alphaSum, double beta, int[][] typeTopicCounts, int[] tokensPerTopic)
           
 
Method Summary
 double evaluateLeftToRight(InstanceList testing, int numParticles, boolean usingResampling, java.io.PrintStream docProbabilityStream)
           
 int[] getTokensPerTopic()
           
 int[][] getTypeTopicCounts()
           
protected  double[] leftToRight(FeatureSequence tokenSequence, boolean usingResampling)
           
static MarginalProbEstimator read(java.io.File f)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

numTopics

protected int numTopics

topicMask

protected int topicMask

topicBits

protected int topicBits

alpha

protected double[] alpha

alphaSum

protected double alphaSum

beta

protected double beta

betaSum

protected double betaSum

smoothingOnlyMass

protected double smoothingOnlyMass

cachedCoefficients

protected double[] cachedCoefficients

typeTopicCounts

protected int[][] typeTopicCounts

tokensPerTopic

protected int[] tokensPerTopic

random

protected Randoms random
Constructor Detail

MarginalProbEstimator

public MarginalProbEstimator(int numTopics,
                             double[] alpha,
                             double alphaSum,
                             double beta,
                             int[][] typeTopicCounts,
                             int[] tokensPerTopic)
Method Detail

getTokensPerTopic

public int[] getTokensPerTopic()

getTypeTopicCounts

public int[][] getTypeTopicCounts()

evaluateLeftToRight

public double evaluateLeftToRight(InstanceList testing,
                                  int numParticles,
                                  boolean usingResampling,
                                  java.io.PrintStream docProbabilityStream)

leftToRight

protected double[] leftToRight(FeatureSequence tokenSequence,
                               boolean usingResampling)

read

public static MarginalProbEstimator read(java.io.File f)
                                  throws java.lang.Exception
Throws:
java.lang.Exception