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

T

the label (category) class

Inheritance
LogProbability<T>
Inherited Members

Constructors

LogProbability(T)

public LogProbability(T label)

Parameters

label T

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

probability double

the probability weight to add

IsLarger(Probability)

Checks if a probability is greater than the old one.

public override bool IsLarger(Probability probability)

Parameters

probability Probability

the probability to assign

Returns

bool

Set(Probability)

Assigns a probability to a label, discarding any previously assigned probability.

public override void Set(Probability probability)

Parameters

probability Probability

the probability to assign

Set(double)

Assigns a probability to a label, discarding any previously assigned probability.

public override void Set(double probability)

Parameters

probability double

the 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

probability Probability

the 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

probability double

the probability to assign

SetLog(double)

Assigns a log probability to a label, discarding any previously assigned probability.

public override void SetLog(double probability)

Parameters

probability double

the log probability to assign