Class LogProbability<T>
- Namespace
- NOpenNLP.Tools.Ml.Naivebayes
- Assembly
- NOpenNLP.Tools.dll
Class implementing the probability for a label.
public class LogProbability<T> : Probability<T>
Type Parameters
Tthe label (category) class
- Inheritance
-
Probability<T>LogProbability<T>
- Inherited Members
Constructors
LogProbability(T)
public LogProbability(T label)
Parameters
labelT
Properties
Label
Returns the probabilities associated with all labels
public override 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 override void AddIn(double probability)
Parameters
probabilitydoublethe probability weight to add
IsLarger(Probability)
Checks if a probability is greater than the old one.
public override bool IsLarger(Probability probability)
Parameters
probabilityProbabilitythe probability to assign
Returns
Set(Probability)
Assigns a probability to a label, discarding any previously assigned probability.
public override void Set(Probability probability)
Parameters
probabilityProbabilitythe probability to assign
Set(double)
Assigns a probability to a label, discarding any previously assigned probability.
public override 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 override 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 override void SetIfLarger(double probability)
Parameters
probabilitydoublethe probability to assign
SetLog(double)
Assigns a log probability to a label, discarding any previously assigned probability.
public override void SetLog(double probability)
Parameters
probabilitydoublethe log probability to assign