Klasse LogProbabilities<T>

java.lang.Object
opennlp.tools.ml.naivebayes.Probabilities<T>
opennlp.tools.ml.naivebayes.LogProbabilities<T>
Typparameter:
T - the label (category) class

public class LogProbabilities<T> extends Probabilities<T>
Class implementing the probability distribution over labels returned by a classifier as a log of probabilities.

This is necessary because floating point precision in Java does not allow for high-accuracy representation of very low probabilities such as would occur in a text categorizer.

Siehe auch:
  • Konstruktorübersicht

    Konstruktoren
    Konstruktor
    Beschreibung
     
  • Methodenübersicht

    Modifizierer und Typ
    Methode
    Beschreibung
    void
    addIn(T t, double probability, int count)
    Compounds the existing probability mass on the label t with the new probability passed in to the method.
    void
     
    get(T t)
     
     
    getLog(T t)
     
     
    void
    set(T t, double probability)
    Assigns a probability to a label t, discarding any previously assigned probability.
    void
    set(T t, Probability<T> probability)
    Assigns a probability to a label t, discarding any previously assigned probability.
    void
    setIfLarger(T t, double probability)
    Assigns a probability to a label t, discarding any previously assigned probability, if the new probability is greater than the old one.
    void
    setLog(T t, double probability)
    Assigns a log probability to a label t, discarding any previously assigned probability.

    Von Klasse geerbte Methoden opennlp.tools.ml.naivebayes.Probabilities

    getConfidence, getKeys, getMaxValue, setConfidence, toString

    Von Klasse geerbte Methoden java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Konstruktordetails

    • LogProbabilities

      public LogProbabilities()
  • Methodendetails

    • set

      public void set(T t, double probability)
      Assigns a probability to a label t, discarding any previously assigned probability.
      Setzt außer Kraft:
      set in Klasse Probabilities<T>
      Parameter:
      t - The label to which the probability is being assigned.
      probability - The probability to assign.
    • set

      public void set(T t, Probability<T> probability)
      Assigns a probability to a label t, discarding any previously assigned probability.
      Setzt außer Kraft:
      set in Klasse Probabilities<T>
      Parameter:
      t - The label to which the probability is being assigned.
      probability - The Probability<T> to assign.
    • setIfLarger

      public void setIfLarger(T t, double probability)
      Assigns a probability to a label t, discarding any previously assigned probability, if the new probability is greater than the old one.
      Setzt außer Kraft:
      setIfLarger in Klasse Probabilities<T>
      Parameter:
      t - The label to which the probability is being assigned.
      probability - The probability to assign.
    • setLog

      public void setLog(T t, double probability)
      Assigns a log probability to a label t, discarding any previously assigned probability.
      Setzt außer Kraft:
      setLog in Klasse Probabilities<T>
      Parameter:
      t - The label to which the log probability is being assigned.
      probability - The log probability to assign.
    • addIn

      public void addIn(T t, double probability, int count)
      Compounds the existing probability mass on the label t with the new probability passed in to the method.
      Setzt außer Kraft:
      addIn in Klasse Probabilities<T>
      Parameter:
      t - The label whose probability mass is being updated.
      probability - The probability weight to add.
      count - The amplifying factor for the probability compounding.
    • get

      public Double get(T t)
      Setzt außer Kraft:
      get in Klasse Probabilities<T>
      Parameter:
      t - The label whose probability shall be returned.
      Gibt zurück:
      Retrieves the probability associated with the label t.
    • getLog

      public Double getLog(T t)
      Setzt außer Kraft:
      getLog in Klasse Probabilities<T>
      Parameter:
      t - The label whose log probability shall be returned.
      Gibt zurück:
      Retrieves the log probability associated with the label t.
    • discardCountsBelow

      public void discardCountsBelow(double i)
      Setzt außer Kraft:
      discardCountsBelow in Klasse Probabilities<T>
    • getAll

      public Map<T,Double> getAll()
      Setzt außer Kraft:
      getAll in Klasse Probabilities<T>
      Gibt zurück:
      Retrieves a Map of all labels and their probabilities.
    • getMax

      public T getMax()
      Setzt außer Kraft:
      getMax in Klasse Probabilities<T>
      Gibt zurück:
      Retrieves the label that has the highest associated probability