Interface IPrior
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
distdouble[]An array to be populated with the log of the prior distribution.
contextContext[]The indices of the contextual predicates for an event.
valuesfloat[]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
distdouble[]An array to be populated with the log of the prior distribution.
contextint[]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
distdouble[]An array to be populated with the log of the prior distribution.
contextint[]The indices of the contextual predicates for an event.
valuesfloat[]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)