Class RTopicModel

  • All Implemented Interfaces:

    public class RTopicModel
    extends ParallelTopicModel
    A wrapper for a topic model to be used from the R statistical package through rJava. R does not distinguish between integers and floating point numbers, so many of these methods simply translate doubles to ints.
    See Also:
    Serialized Form
    • Constructor Detail

      • RTopicModel

        public RTopicModel​(double numTopics,
                           double alpha,
                           double beta)
    • Method Detail

      • loadDocuments

        public void loadDocuments​(java.lang.String filename)
      • loadDocuments

        public void loadDocuments​(InstanceList instances)
      • addInstance

        public static void addInstance​(InstanceList instances,
                                       java.lang.String id,
                                       java.lang.String text)
        This is a helper method that simplifies class casting from rJava.
      • addInstances

        public static void addInstances​(InstanceList instances,
                                        java.lang.String[] ids,
                                        java.lang.String[] texts)
      • setAlphaOptimization

        public void setAlphaOptimization​(double frequency,
                                         double burnin)
      • train

        public void train​(double numIterations)
      • maximize

        public void maximize​(double numIterations)
        Run iterated conditional modes
      • getAlpha

        public double[] getAlpha()
      • getVocabulary

        public java.lang.String[] getVocabulary()
      • getDocumentNames

        public java.lang.String[] getDocumentNames()
      • getWordFrequencies

        public double[][] getWordFrequencies()
      • writeState

        public void writeState​(java.lang.String filename)