Class GISModel
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
paramsContext[]The parameters of the model.
predLabelsstring[]The names of the predicates used in this model.
outcomeNamesstring[]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
paramsContext[]The parameters of the model.
predLabelsstring[]The names of the predicates used in this model.
outcomeNamesstring[]The names of the outcomes this model predicts.
priorIPriorThe 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
contextint[]The integer values of the predicates which have been observed at the present decision point.
priordouble[]The prior distribution for the specified context.
modelEvalParametersThe 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
contextstring[]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
contextstring[]A list of String names of the contextual predicates which are to be evaluated together.
outsumsdouble[]
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
contextstring[]A list of String names of the contextual predicates which are to be evaluated together.
valuesfloat[]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
contextstring[]The names of the predicates which have been observed at the present decision point.
valuesfloat[]outsumsdouble[]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).