calhoun.analysis.crf
Class SemiMarkovSetup

java.lang.Object
  extended by calhoun.analysis.crf.SemiMarkovSetup

public class SemiMarkovSetup
extends java.lang.Object

holds additional configuration information used in semi-Markov CRFs.


Constructor Summary
SemiMarkovSetup()
          default constructor used by Spring during automatic configuration
SemiMarkovSetup(short[] lengths)
          constructs using this set of maximum lengths.
SemiMarkovSetup(short[] lengths, boolean ignore)
          constructs using this set of maximum lengths and value for the ignore flag.
SemiMarkovSetup(short[] minLen, short[] maxLen, boolean ignore)
          constructs will all parameters.
 
Method Summary
 short[] getMaxLengths()
          gets the maximum lengths for each state.
 short[] getMinLengths()
          gets the minimum lengths for each state.
 boolean isIgnoreSemiMarkovSelfTransitions()
          gets the flag indicating that self-transition edges for the semi-Markov states should be ignored.
 void setIgnoreSemiMarkovSelfTransitions(boolean ignoreSemiMarkovSelfTransitions)
          sets the flag indicating that self-transition edges for the semi-Markov states should be ignored.
 void setMaxLengths(short[] lengths)
          sets the maximum lengths for each state.
 void setMinLengths(short[] lengths)
          sets the minimum lengths for each state.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SemiMarkovSetup

public SemiMarkovSetup()
default constructor used by Spring during automatic configuration


SemiMarkovSetup

public SemiMarkovSetup(short[] lengths)
constructs using this set of maximum lengths.


SemiMarkovSetup

public SemiMarkovSetup(short[] lengths,
                       boolean ignore)
constructs using this set of maximum lengths and value for the ignore flag.


SemiMarkovSetup

public SemiMarkovSetup(short[] minLen,
                       short[] maxLen,
                       boolean ignore)
constructs will all parameters.

Method Detail

getMinLengths

public short[] getMinLengths()
gets the minimum lengths for each state. The minimum value is 1. This array defaults to all 1's if it was not set explicitly.

Returns:
an array of the minimum lengths of each state.

setMinLengths

public void setMinLengths(short[] lengths)
sets the minimum lengths for each state.

Parameters:
lengths - an array of the minimum lengths of each state.

getMaxLengths

public short[] getMaxLengths()
gets the maximum lengths for each state. The minimum value is 1, which corresponds to the special case of a Markov feature. This value has no default. It is usually configured through the XML model file.

Returns:
an array of the maximum lengths of each state.

setMaxLengths

public void setMaxLengths(short[] lengths)
sets the maximum lengths for each state.

Parameters:
lengths - an array of the minimum lengths of each state.

isIgnoreSemiMarkovSelfTransitions

public boolean isIgnoreSemiMarkovSelfTransitions()
gets the flag indicating that self-transition edges for the semi-Markov states should be ignored. This flag is useful if you are using the same model definition for both Markov and semi-Markov models. In a Markov model a self-transition means that a state can be repeated multiple times, essentially forming a segment. However, in a semi-Markov a self-transition means a transition between two segments with the same state. This distinction means that the same state transition graph will mean different things under the two models. If this flag is set to true, which is the default, then it is assumed that no two segments in the semi-Markov model can have the same state, and so self-transitions in the semi-Markov states are ignored. This forces the state transition graph to have the same meaning for both cases.

This flag does not affect Markov states, those with a max length of 1. This means that a state may legally occur in consecutive positions if the maximum length for that state is one and the graph contains a self-transition for that state.

Returns:
true if self-transition edges in the model should be ignored.

setIgnoreSemiMarkovSelfTransitions

public void setIgnoreSemiMarkovSelfTransitions(boolean ignoreSemiMarkovSelfTransitions)
sets the flag indicating that self-transition edges for the semi-Markov states should be ignored.

Parameters:
ignoreSemiMarkovSelfTransitions - true if self-transition edges for the semi-Markov states should be ignored.