Class Context

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

Class which associates a real valued parameter or expected value with a particular contextual predicate or feature. This is used to store maxent model parameters as well as model and empirical expected values.

public class Context
Inheritance
Context
Derived
Inherited Members

Constructors

Context(int[], double[])

Creates a new parameters object with the specified parameters associated with the specified outcome pattern.

public Context(int[] outcomePattern, double[] parameters)

Parameters

outcomePattern int[]

Array of outcomes for which parameters exists for this context.

parameters double[]

Parameters for the outcomes specified.

Fields

outcomes

The outcomes which occur with this context.

protected readonly int[] outcomes

Field Value

int[]

parameters

The real valued parameters or expected values for this context.

protected readonly double[] parameters

Field Value

double[]

Properties

Outcomes

Returns the outcomes for which parameters exists for this context.

public virtual int[] Outcomes { get; }

Property Value

int[]

Array of outcomes for which parameters exists for this context.

Parameters

Returns the parameters or expected values for the outcomes which occur with this context.

public virtual double[] Parameters { get; }

Property Value

double[]

Array of parameters for the outcomes of this context.

Methods

Equals(object?)

Determines whether the specified object is equal to the current object.

public override bool Equals(object? obj)

Parameters

obj object

The object to compare with the current object.

Returns

bool

true if the specified object is equal to the current object; otherwise, false.

GetHashCode()

Serves as the default hash function.

public override int GetHashCode()

Returns

int

A hash code for the current object.