Interface IPrior

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

This interface allows one to implement a prior distribution for use in maximum entropy model training.

public interface IPrior

Methods

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.

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.

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.

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.

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

Parameters

outcomeLabels string[]

An array of each outcome label.

contextLabels string[]

An array of each context label.