Class MaxEntMarkovModel

  • All Implemented Interfaces:
    Classifier, Predictor

    public final class MaxEntMarkovModel
    extends AbstractClassifier
    Maximum entropy markov model for named entity recognition (classifying labels in sequence learning).
    Author:
    thomas.jungblut
    • Constructor Detail

      • MaxEntMarkovModel

        public MaxEntMarkovModel​(Minimizer minimizer,
                                 int numIterations,
                                 boolean verbose)
      • MaxEntMarkovModel

        public MaxEntMarkovModel​(de.jungblut.math.dense.DenseDoubleMatrix theta,
                                 int classes)
    • Method Detail

      • train

        public void train​(de.jungblut.math.DoubleVector[] features,
                          de.jungblut.math.DoubleVector[] outcome)
        Description copied from interface: Classifier
        Trains this classifier with the given features and the outcome.
        Specified by:
        train in interface Classifier
        Overrides:
        train in class AbstractClassifier
        outcome - the outcome must have classes labeled as doubles. E.G. in the binary case you have a single element and decide between 0d and 1d. In higher dimensional cases you have each of these single elements mapped to a dimension.
      • predict

        public de.jungblut.math.DoubleVector predict​(de.jungblut.math.DoubleVector features)
        Description copied from interface: Predictor
        Classifies the given features.
        Returns:
        the vector that contains an indicator at the index of the class. Usually zero or 1, in some cases it is a probability or activation value.
      • getTheta

        public de.jungblut.math.DoubleMatrix getTheta()
        Returns:
        the learned parameters.
      • predict

        public de.jungblut.math.DoubleVector predict​(de.jungblut.math.DoubleVector feature,
                                                     de.jungblut.math.DoubleVector[] featuresPerState)
      • predict

        public de.jungblut.math.DoubleMatrix predict​(de.jungblut.math.DoubleMatrix features,
                                                     de.jungblut.math.DoubleMatrix featuresPerState)