Interface IMaxentModel
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
contextstring[]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
contextstring[]A list of String names of the contextual predicates which are to be evaluated together.
probsdouble[]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
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.
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
outcomesdouble[]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
outcomesdouble[]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
outcomestringthe 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
iintthe index for which the name of the associated outcome is desired.
Returns
- string
the string name of the outcome