Interface IMaxentModel

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

Interface for maximum entropy models.

public interface IMaxentModel

Properties

NumOutcomes

Returns the number of outcomes for this model.

int NumOutcomes { get; }

Property Value

int

The number of outcomes.

Methods

Eval(string[])

Evaluates a context.

double[] Eval(string[] context)

Parameters

context string[]

A list of String names of the contextual predicates which are to be evaluated together.

Returns

double[]

an array of the probabilities for each of the different outcomes, all of which sum to 1.

Eval(string[], double[])

Evaluates a context.

double[] Eval(string[] context, double[] probs)

Parameters

context string[]

A list of String names of the contextual predicates which are to be evaluated together.

probs double[]

An array which is populated with the probabilities for each of the different outcomes, all of which sum to 1.

Returns

double[]

an array of the probabilities for each of the different outcomes, all of which sum to 1.

Eval(string[], float[])

Evaluates a contexts with the specified context values.

double[] Eval(string[] context, float[] values)

Parameters

context string[]

A list of String names of the contextual predicates which are to be evaluated together.

values float[]

The values associated with each context.

Returns

double[]

an array of the probabilities for each of the different outcomes, all of which sum to 1.

GetAllOutcomes(double[])

Return a string matching all the outcome names with all the probabilities produced by the Eval(string[]) method.

string GetAllOutcomes(double[] outcomes)

Parameters

outcomes double[]

A double array as returned by the Eval(string[]) method.

Returns

string

String containing outcome names paired with the normalized probability (contained in the outcomes) for each one.

GetBestOutcome(double[])

Simple function to return the outcome associated with the index containing the highest probability in the array.

string GetBestOutcome(double[] outcomes)

Parameters

outcomes double[]

A double array as returned by the Eval(string[]) method.

Returns

string

the name of the best outcome

GetIndex(string)

Gets the index associated with the string name of the given outcome.

int GetIndex(string outcome)

Parameters

outcome string

the string name of the outcome for which the index is desired

Returns

int

the index if the given outcome label exists for this model, -1 if it does not.

GetOutcome(int)

Gets the string name of the outcome associated with the index i.

string GetOutcome(int i)

Parameters

i int

the index for which the name of the associated outcome is desired.

Returns

string

the string name of the outcome