Class NaiveBayesTrainer

All Implemented Interfaces:
Trainer, EventTrainer

public class NaiveBayesTrainer extends AbstractEventTrainer
Trains models using the combination of EM algorithm and Naive Bayes classifier which is described in:

Text Classification from Labeled and Unlabeled Documents using EM Nigam, McCallum, et al. paper of 2000

See Also:
  • Field Details

    • logger

      private static final org.slf4j.Logger logger
    • NAIVE_BAYES_VALUE

      public static final String NAIVE_BAYES_VALUE
      See Also:
    • numUniqueEvents

      private int numUniqueEvents
      Number of unique events which occurred in the event set.
    • numEvents

      private int numEvents
      Number of events in the event set.
    • numPreds

      private int numPreds
      Number of predicates.
    • numOutcomes

      private int numOutcomes
      Number of outcomes.
    • contexts

      private int[][] contexts
      Records the array of predicates seen in each event.
    • values

      private float[][] values
      The value associates with each context. If null then context values are assumes to be 1.
    • outcomeList

      private int[] outcomeList
      List of outcomes for each event i, in context[i].
    • numTimesEventsSeen

      private int[] numTimesEventsSeen
      Records the num of times an event has been seen for each event i, in context[i].
    • outcomeLabels

      private String[] outcomeLabels
      Stores the String names of the outcomes. The NaiveBayes only tracks outcomes as ints, and so this array is needed to save the model to disk and thereby allow users to know what the outcome was in human understandable terms.
    • predLabels

      private String[] predLabels
      Stores the String names of the predicates.The NaiveBayes only tracks predicates as ints, and so this array is needed to save the model to disk and thereby allow users to know what the outcome was in human understandable terms.
  • Constructor Details

  • Method Details