Package opennlp.tools.ml.maxent

# Class GISModel

java.lang.Object
opennlp.tools.ml.model.AbstractModel
opennlp.tools.ml.maxent.GISModel

All Implemented Interfaces:
  `opennlp.tools.ml.model.MaxentModel`

public final class GISModel extends opennlp.tools.ml.model.AbstractModel
A maximum entropy model which has been trained using the Generalized Iterative Scaling (GIS) procedure.

See Also:
  - `AbstractModel`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `GISModel(opennlp.tools.ml.model.Context[] params, String[] predLabels, String[] outcomeNames)`
  Initializes a `GISModel` with the specified parameters, outcome names, and predicate/feature labels.
  `GISModel(opennlp.tools.ml.model.Context[] params, String[] predLabels, String[] outcomeNames, opennlp.tools.ml.model.Prior prior)`
  Initializes a `GISModel` with the specified parameters, outcome names, and predicate/feature labels.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `boolean`
  `equals(Object obj)`
  `static double[]`
  `eval(int[] context, double[] prior, opennlp.tools.ml.model.EvalParameters model)`
  Evaluates a context and return an array of the likelihood of each outcome given the specified context and the specified parameters.
  `double[]`
  `eval(String[] context)`
  Evaluates a context and return an array of the likelihood of each outcome given that context.
  `double[]`
  `eval(String[] context, double[] outsums)`
  `double[]`
  `eval(String[] context, float[] values)`
  `double[]`
  `eval(String[] context, float[] values, double[] outsums)`
  Evaluates a context and return an array of the likelihood of each outcome given that context.
  `int`
  `hashCode()`

  ### Methods inherited from class opennlp.tools.ml.model.AbstractModel

  `getAllOutcomes, getBestOutcome, getDataStructures, getIndex, getModelType, getNumOutcomes, getOutcome`

  ### Methods inherited from class java.lang.Object

  `getClass, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### GISModel

    public GISModel(opennlp.tools.ml.model.Context[] params, String[] predLabels, String[] outcomeNames)
    Initializes a `GISModel` with the specified parameters, outcome names, and predicate/feature labels.
    Parameters:
      `params` - The `parameters` of the model.
      `predLabels` - The names of the predicates used in this model.
      `outcomeNames` - The names of the outcomes this model predicts.

  - ### GISModel

    public GISModel(opennlp.tools.ml.model.Context[] params, String[] predLabels, String[] outcomeNames, opennlp.tools.ml.model.Prior prior)
    Initializes a `GISModel` with the specified parameters, outcome names, and predicate/feature labels.
    Parameters:
      `params` - The `parameters` of the model.
      `predLabels` - The names of the predicates used in this model.
      `outcomeNames` - The names of the outcomes this model predicts.
      `prior` - The `Prior` to be used with this model.

- ## Method Details

  - ### eval

    public double[] eval(String[] context)
    Evaluates a context and return an array of the likelihood of each outcome given that context.
    Parameters:
      `context` - The names of the predicates which have been observed at the present decision point.
    Returns:
      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 `AbstractModel.getOutcome(int)`.

  - ### eval

    public double[] eval(String[] context, float[] values)

  - ### eval

    public double[] eval(String[] context, double[] outsums)

  - ### eval

    public double[] eval(String[] context, float[] values, double[] outsums)
    Evaluates a context and return an array of the likelihood of each outcome given that context.
    Parameters:
      `context` - The names of the predicates which have been observed at the present decision point.
      `outsums` - This is where the distribution is stored.
    Returns:
      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 `AbstractModel.getOutcome(int)`.

  - ### eval

    public static double[] eval(int[] context, double[] prior, opennlp.tools.ml.model.EvalParameters model)
    Evaluates a context and return an array of the likelihood of each outcome given the specified context and the specified parameters.
    Parameters:
      `context` - The integer values of the predicates which have been observed at the present decision point.
      `prior` - The prior distribution for the specified context.
      `model` - The set of parameters used in this computation.
    Returns:
      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 `AbstractModel.getOutcome(int)`.

  - ### hashCode

    public int hashCode()
    Overrides:
      `hashCode` in class `opennlp.tools.ml.model.AbstractModel`

  - ### equals

    public boolean equals(Object obj)
    Overrides:
      `equals` in class `opennlp.tools.ml.model.AbstractModel`