Class LDAHyper

  • All Implemented Interfaces:
    java.io.Serializable
    Direct Known Subclasses:
    LDAStream

    @Deprecated
    public class LDAHyper
    extends java.lang.Object
    implements java.io.Serializable
    Deprecated.
    Use ParallelTopicModel instead, which uses substantially faster data structures even for non-parallel operation.
    Latent Dirichlet Allocation with optimized hyperparameters
    Author:
    David Mimno, Andrew McCallum
    See Also:
    Serialized Form
    • Field Detail

      • alphabet

        protected Alphabet alphabet
        Deprecated.
      • topicAlphabet

        protected LabelAlphabet topicAlphabet
        Deprecated.
      • numTopics

        protected int numTopics
        Deprecated.
      • numTypes

        protected int numTypes
        Deprecated.
      • alpha

        protected double[] alpha
        Deprecated.
      • alphaSum

        protected double alphaSum
        Deprecated.
      • beta

        protected double beta
        Deprecated.
      • betaSum

        protected double betaSum
        Deprecated.
      • smoothingOnlyMass

        protected double smoothingOnlyMass
        Deprecated.
      • cachedCoefficients

        protected double[] cachedCoefficients
        Deprecated.
      • oneDocTopicCounts

        protected int[] oneDocTopicCounts
        Deprecated.
      • typeTopicCounts

        protected com.carrotsearch.hppc.IntIntHashMap[] typeTopicCounts
        Deprecated.
      • tokensPerTopic

        protected int[] tokensPerTopic
        Deprecated.
      • docLengthCounts

        protected int[] docLengthCounts
        Deprecated.
      • topicDocCounts

        protected int[][] topicDocCounts
        Deprecated.
      • iterationsSoFar

        public int iterationsSoFar
        Deprecated.
      • numIterations

        public int numIterations
        Deprecated.
      • burninPeriod

        public int burninPeriod
        Deprecated.
      • saveSampleInterval

        public int saveSampleInterval
        Deprecated.
      • optimizeInterval

        public int optimizeInterval
        Deprecated.
      • showTopicsInterval

        public int showTopicsInterval
        Deprecated.
      • wordsPerTopic

        public int wordsPerTopic
        Deprecated.
      • outputModelInterval

        protected int outputModelInterval
        Deprecated.
      • outputModelFilename

        protected java.lang.String outputModelFilename
        Deprecated.
      • saveStateInterval

        protected int saveStateInterval
        Deprecated.
      • stateFilename

        protected java.lang.String stateFilename
        Deprecated.
      • random

        protected Randoms random
        Deprecated.
      • formatter

        protected java.text.NumberFormat formatter
        Deprecated.
      • printLogLikelihood

        protected boolean printLogLikelihood
        Deprecated.
    • Constructor Detail

      • LDAHyper

        public LDAHyper​(int numberOfTopics)
        Deprecated.
      • LDAHyper

        public LDAHyper​(int numberOfTopics,
                        double alphaSum,
                        double beta)
        Deprecated.
      • LDAHyper

        public LDAHyper​(int numberOfTopics,
                        double alphaSum,
                        double beta,
                        Randoms random)
        Deprecated.
      • LDAHyper

        public LDAHyper​(LabelAlphabet topicAlphabet,
                        double alphaSum,
                        double beta,
                        Randoms random)
        Deprecated.
    • Method Detail

      • getAlphabet

        public Alphabet getAlphabet()
        Deprecated.
      • getTopicAlphabet

        public LabelAlphabet getTopicAlphabet()
        Deprecated.
      • getNumTopics

        public int getNumTopics()
        Deprecated.
      • getCountFeatureTopic

        public int getCountFeatureTopic​(int featureIndex,
                                        int topicIndex)
        Deprecated.
      • getCountTokensPerTopic

        public int getCountTokensPerTopic​(int topicIndex)
        Deprecated.
      • setTestingInstances

        public void setTestingInstances​(InstanceList testing)
        Deprecated.
        Held-out instances for empirical likelihood calculation
      • setNumIterations

        public void setNumIterations​(int numIterations)
        Deprecated.
      • setBurninPeriod

        public void setBurninPeriod​(int burninPeriod)
        Deprecated.
      • setTopicDisplay

        public void setTopicDisplay​(int interval,
                                    int n)
        Deprecated.
      • setRandomSeed

        public void setRandomSeed​(int seed)
        Deprecated.
      • setOptimizeInterval

        public void setOptimizeInterval​(int interval)
        Deprecated.
      • setModelOutput

        public void setModelOutput​(int interval,
                                   java.lang.String filename)
        Deprecated.
      • setSaveState

        public void setSaveState​(int interval,
                                 java.lang.String filename)
        Deprecated.
        Define how often and where to save the state
        Parameters:
        interval - Save a copy of the state every interval iterations.
        filename - Save the state to this file, with the iteration number as a suffix
      • instanceLength

        protected int instanceLength​(Instance instance)
        Deprecated.
      • addInstances

        public void addInstances​(InstanceList training)
        Deprecated.
      • initializeHistogramsAndCachedValues

        protected void initializeHistogramsAndCachedValues()
        Deprecated.
        Gather statistics on the size of documents and create histograms for use in Dirichlet hyperparameter optimization.
      • estimate

        public void estimate()
                      throws java.io.IOException
        Deprecated.
        Throws:
        java.io.IOException
      • estimate

        public void estimate​(int iterationsThisRound)
                      throws java.io.IOException
        Deprecated.
        Throws:
        java.io.IOException
      • sampleTopicsForOneDoc

        protected void sampleTopicsForOneDoc​(FeatureSequence tokenSequence,
                                             FeatureSequence topicSequence,
                                             boolean shouldSaveState,
                                             boolean readjustTopicsAndStats)
        Deprecated.
      • getSortedTopicWords

        public IDSorter[] getSortedTopicWords​(int topic)
        Deprecated.
      • printTopWords

        public void printTopWords​(java.io.File file,
                                  int numWords,
                                  boolean useNewLines)
                           throws java.io.IOException
        Deprecated.
        Throws:
        java.io.IOException
      • printTopWords

        public void printTopWords​(java.io.PrintStream out,
                                  int numWords,
                                  boolean usingNewLines)
        Deprecated.
      • topicXMLReport

        public void topicXMLReport​(java.io.PrintWriter out,
                                   int numWords)
        Deprecated.
      • topicXMLReportPhrases

        public void topicXMLReportPhrases​(java.io.PrintStream out,
                                          int numWords)
        Deprecated.
      • printDocumentTopics

        public void printDocumentTopics​(java.io.File f)
                                 throws java.io.IOException
        Deprecated.
        Throws:
        java.io.IOException
      • printDocumentTopics

        public void printDocumentTopics​(java.io.PrintWriter pw)
        Deprecated.
      • printDocumentTopics

        public void printDocumentTopics​(java.io.PrintWriter pw,
                                        double threshold,
                                        int max)
        Deprecated.
        Parameters:
        pw - A print writer
        threshold - Only print topics with proportion greater than this number
        max - Print no more than this many topics
      • printState

        public void printState​(java.io.File f)
                        throws java.io.IOException
        Deprecated.
        Throws:
        java.io.IOException
      • printState

        public void printState​(java.io.PrintStream out)
        Deprecated.
      • write

        public void write​(java.io.File f)
        Deprecated.
      • read

        public static LDAHyper read​(java.io.File f)
        Deprecated.
      • topicLabelMutualInformation

        public double topicLabelMutualInformation()
        Deprecated.
      • empiricalLikelihood

        public double empiricalLikelihood​(int numSamples,
                                          InstanceList testing)
        Deprecated.
      • modelLogLikelihood

        public double modelLogLikelihood()
        Deprecated.
      • main

        public static void main​(java.lang.String[] args)
                         throws java.io.IOException
        Deprecated.
        Throws:
        java.io.IOException