Klasse Probability<T>

java.lang.Object
opennlp.tools.ml.naivebayes.Probability<T>
Typparameter:
T - The label (category) class.
Bekannte direkte Unterklassen:
LogProbability

public class Probability<T> extends Object
Class implementing the probability for a label.
  • Konstruktorübersicht

    Konstruktoren
    Konstruktor
    Beschreibung
    Probability(T label)
    Instantiates a Probability with a given label.
  • Methodenübersicht

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

    Von Klasse geerbte Methoden java.lang.Object

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

    • Probability

      public Probability(T label)
      Instantiates a Probability with a given label.
      Parameter:
      label - The label to assign probabilities to.
  • Methodendetails

    • set

      public void set(double probability)
      Assigns a probability to a label, discarding any previously assigned probability.
      Parameter:
      probability - The probability to assign.
    • set

      public void set(Probability<T> probability)
      Assigns a probability to a label, discarding any previously assigned probability.
      Parameter:
      probability - The probability to assign.
    • setIfLarger

      public void setIfLarger(double probability)
      Assigns a probability to a label, discarding any previously assigned probability, if the new probability is greater than the old one.
      Parameter:
      probability - The probability to assign.
    • setIfLarger

      public void setIfLarger(Probability<T> probability)
      Assigns a probability to a label, discarding any previously assigned probability, if the new probability is greater than the old one.
      Parameter:
      probability - The probability to assign.
    • isLarger

      public boolean isLarger(Probability<T> probability)
      Checks if a probability is greater than the old one.
      Parameter:
      probability - The probability to assign.
      Gibt zurück:
      true if a probability is greater than the old one, false otherwise.
    • setLog

      public void setLog(double probability)
      Assigns a log probability to a label, discarding any previously assigned probability.
      Parameter:
      probability - The log probability to assign.
    • addIn

      public void addIn(double probability)
      Compounds the existing probability mass on the label with the new probability passed in to the method.
      Parameter:
      probability - The probability weight to add.
    • get

      public Double get()
      Gibt zurück:
      Retrieves the probability associated with a label.
    • getLog

      public Double getLog()
      Gibt zurück:
      Retrieves the log probability associated with a label.
    • getLabel

      public T getLabel()
      Gibt zurück:
      Retrieves the probabilities associated with all labels.
    • toString

      public String toString()
      Setzt außer Kraft:
      toString in Klasse Object