Class GISModel

Namespace
NOpenNLP.Tools.Ml.Maxent
Assembly
NOpenNLP.Tools.dll

A maximum entropy model which has been trained using the Generalized Iterative Scaling procedure (implemented in GIS.java).

public sealed class GISModel : AbstractModel, IMaxentModel
Inheritance
GISModel
Implements
Inherited Members

Constructors

GISModel(Context[], string[], string[])

Creates a new model with the specified parameters, outcome names, and predicate/feature labels.

public GISModel(Context[] @params, string[] predLabels, string[] outcomeNames)

Parameters

params Context[]

The parameters of the model.

predLabels string[]

The names of the predicates used in this model.

outcomeNames string[]

The names of the outcomes this model predicts.

GISModel(Context[], string[], string[], IPrior)

Creates a new model with the specified parameters, outcome names, and predicate/feature labels.

public GISModel(Context[] @params, string[] predLabels, string[] outcomeNames, IPrior prior)

Parameters

params Context[]

The parameters of the model.

predLabels string[]

The names of the predicates used in this model.

outcomeNames string[]

The names of the outcomes this model predicts.

prior IPrior

The prior to be used with this model.

Methods

Eval(int[], double[], EvalParameters)

Use this model to evaluate a context and return an array of the likelihood of each outcome given the specified context and the specified parameters.

public static double[] Eval(int[] context, double[] prior, EvalParameters model)

Parameters

context int[]

The integer values of the predicates which have been observed at the present decision point.

prior double[]

The prior distribution for the specified context.

model EvalParameters

The set of parametes used in this computation.

Returns

double[]

The normalized probabilities for the outcomes given the context. The indexes of the double[] are the outcome ids, and the actual string representation of the outcomes can be obtained from the method getOutcome(int i).

Eval(string[])

Use this model to evaluate a context and return an array of the likelihood of each outcome given that context.

public override double[] Eval(string[] context)

Parameters

context string[]

The names of the predicates which have been observed at the present decision point.

Returns

double[]

The normalized probabilities for the outcomes given the context. The indexes of the double[] are the outcome ids, and the actual string representation of the outcomes can be obtained from the method getOutcome(int i).

Eval(string[], double[])

Evaluates a context.

public override double[] Eval(string[] context, double[] outsums)

Parameters

context string[]

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

outsums double[]

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.

public override 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.

Eval(string[], float[]?, double[])

Use this model to evaluate a context and return an array of the likelihood of each outcome given that context.

public double[] Eval(string[] context, float[]? values, double[] outsums)

Parameters

context string[]

The names of the predicates which have been observed at the present decision point.

values float[]
outsums double[]

This is where the distribution is stored.

Returns

double[]

The normalized probabilities for the outcomes given the context. The indexes of the double[] are the outcome ids, and the actual string representation of the outcomes can be obtained from the method getOutcome(int i).