Class 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 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
      • printWordProbabilities

        protected boolean printWordProbabilities
    • Constructor Detail

      • MarginalProbEstimator

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

      • setRandomSeed

        public void setRandomSeed​(int seed)
      • setRandom

        public void setRandom​(Randoms r)
      • getTokensPerTopic

        public int[] getTokensPerTopic()
      • getTypeTopicCounts

        public int[][] getTypeTopicCounts()
      • setPrintWords

        public void setPrintWords​(boolean shouldPrint)
      • 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