Class UniformPrior

Namespace
NOpenNLP.Tools.Ml.Model
Assembly
NOpenNLP.Tools.dll

Provide a maximum entropy model with a uniform prior.

public class UniformPrior : IPrior
Inheritance
UniformPrior
Implements
Inherited Members

Methods

Equals(object?)

Determines whether the specified object is equal to the current object.

public override bool Equals(object? obj)

Parameters

obj object

The object to compare with the current object.

Returns

bool

true if the specified object is equal to the current object; otherwise, false.

GetHashCode()

Serves as the default hash function.

public override int GetHashCode()

Returns

int

A hash code for the current object.

LogPrior(double[], Context[], float[])

Populates the specified array with the log of the distribution for the specified context. The returned array will be overwritten and needs to be re-initialized with every call to this method.

public virtual void LogPrior(double[] dist, Context[] context, float[] values)

Parameters

dist double[]

An array to be populated with the log of the prior distribution.

context Context[]

The indices of the contextual predicates for an event.

values float[]

The values associated with the context.

LogPrior(double[], int[])

Populates the specified array with the log of the distribution for the specified context. The returned array will be overwritten and needs to be re-initialized with every call to this method.

public virtual void LogPrior(double[] dist, int[] context)

Parameters

dist double[]

An array to be populated with the log of the prior distribution.

context int[]

The indices of the contextual predicates for an event.

LogPrior(double[], int[]?, float[]?)

Populates the specified array with the log of the distribution for the specified context. The returned array will be overwritten and needs to be re-initialized with every call to this method.

public virtual void LogPrior(double[] dist, int[]? context, float[]? values)

Parameters

dist double[]

An array to be populated with the log of the prior distribution.

context int[]

The indices of the contextual predicates for an event.

values float[]

The values associated with the context.

SetLabels(string[], string[])

Method to specify the label for the outcomes and contexts. This is used to map integer outcomes and contexts to their string values. This method is called prior to any call to #logPrior.

public virtual void SetLabels(string[] outcomeLabels, string[] contextLabels)

Parameters

outcomeLabels string[]

An array of each outcome label.

contextLabels string[]

An array of each context label.