Class Probability<T>
- Namespace
- NOpenNLP.Tools.Ml.Naivebayes
- Assembly
- NOpenNLP.Tools.dll
Class implementing the probability for a label.
public class Probability<T> : Probability
Type Parameters
Tthe label (category) class
- Inheritance
-
Probability<T>
- Derived
- Inherited Members
Constructors
Probability(T)
Class implementing the probability for a label.
public Probability(T label)
Parameters
labelT
Fields
label
protected readonly T label
Field Value
- T
probability
protected double probability
Field Value
Properties
Label
Returns the probabilities associated with all labels
public virtual T Label { get; }
Property Value
- T
the HashMap of labels and their probabilities
Log
Returns the log probability associated with a label
public override double Log { get; }
Property Value
- double
the log probability associated with the label
Value
Returns the probability associated with a label
public override double Value { get; }
Property Value
- double
the probability associated with the label
Methods
AddIn(double)
Compounds the existing probability mass on the label with the new probability passed in to the method.
public virtual void AddIn(double probability)
Parameters
probabilitydoublethe probability weight to add
IsLarger(Probability)
Checks if a probability is greater than the old one.
public virtual bool IsLarger(Probability probability)
Parameters
probabilityProbabilitythe probability to assign
Returns
Set(Probability)
Assigns a probability to a label, discarding any previously assigned probability.
public virtual void Set(Probability probability)
Parameters
probabilityProbabilitythe probability to assign
Set(double)
Assigns a probability to a label, discarding any previously assigned probability.
public virtual void Set(double probability)
Parameters
probabilitydoublethe probability to assign
SetIfLarger(Probability)
Assigns a probability to a label, discarding any previously assigned probability, if the new probability is greater than the old one.
public virtual void SetIfLarger(Probability probability)
Parameters
probabilityProbabilitythe probability to assign
SetIfLarger(double)
Assigns a probability to a label, discarding any previously assigned probability, if the new probability is greater than the old one.
public virtual void SetIfLarger(double probability)
Parameters
probabilitydoublethe probability to assign
SetLog(double)
Assigns a log probability to a label, discarding any previously assigned probability.
public virtual void SetLog(double probability)
Parameters
probabilitydoublethe log probability to assign
ToString()
Returns a string that represents the current object.
public override string ToString()
Returns
- string
A string that represents the current object.