calhoun.analysis.crf
Class BeanModel
java.lang.Object
calhoun.analysis.crf.AbstractFeatureManager
calhoun.analysis.crf.CompositeFeatureManager
calhoun.analysis.crf.BeanModel
- All Implemented Interfaces:
- FeatureManager, FeatureManagerEdge, FeatureManagerEdgeExplicitLength, FeatureManagerNode, FeatureManagerNodeExplicitLength, ModelManager, java.io.Serializable
- Direct Known Subclasses:
- Interval13Model, Interval29Model, ZeroOrderModel
public class BeanModel
- extends CompositeFeatureManager
- implements ModelManager
a useful base class for creating model beans. Defines internal Node and Edge class that can be used to define a hidden state model for the CRF.
The actual state diagram could be implemented through a derived class or through setup of the model in the XML model file. Because XML configuration of
a state model is verbose and because the state diagram is central to most models, we recommend using a derived class to set up the model, as we have
done with gene calling.
- See Also:
- Serialized Form
|
Method Summary |
DenseBooleanMatrix2D |
getLegalTransitions()
returns a boolean matrix where each (row, column) entry contains true if the
model has a legal transition between state row and state column. |
int |
getNumStates()
the number of hidden states. |
int |
getStateIndex(java.lang.String name)
looks up a hidden state's index given it's human readable name. |
java.lang.String |
getStateName(int state)
looks up the human readable name of a hidden state given it's index. |
void |
setEdges(java.util.List<BeanModel.Edge> edges)
sets the list of legal state transitions in this model. |
void |
setNodes(java.util.List<BeanModel.Node> nodes)
sets the list of hidden states in this model. |
| Methods inherited from class calhoun.analysis.crf.CompositeFeatureManager |
addFeatureManager, addFeatureManager, evaluateEdge, evaluateEdgeLength, evaluateNode, evaluateNodeLength, getCacheStrategy, getComponentFeatures, getFeatureName, getFeatureOffset, getNumFeatures, setComponentFeatures, train |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
BeanModel
public BeanModel()
setNodes
public void setNodes(java.util.List<BeanModel.Node> nodes)
- sets the list of hidden states in this model. This will usually be called by a derived class
or by the Spring configuration.
- Parameters:
nodes - the list of hidden states in the model
setEdges
public void setEdges(java.util.List<BeanModel.Edge> edges)
- sets the list of legal state transitions in this model. This will usually be called by a derived class
or by the Spring configuration.
- Parameters:
edges - the list of valid state transitions in the model
getNumStates
public int getNumStates()
- Description copied from interface:
ModelManager
- the number of hidden states.
- Specified by:
getNumStates in interface ModelManager
- Returns:
- the number of hidden states
getStateName
public java.lang.String getStateName(int state)
- Description copied from interface:
ModelManager
- looks up the human readable name of a hidden state given it's index.
- Specified by:
getStateName in interface ModelManager
- Returns:
- string name of the state with this index.
getStateIndex
public int getStateIndex(java.lang.String name)
- Description copied from interface:
ModelManager
- looks up a hidden state's index given it's human readable name.
- Specified by:
getStateIndex in interface ModelManager
- Returns:
- index of the state with this name.
getLegalTransitions
public DenseBooleanMatrix2D getLegalTransitions()
- Description copied from interface:
ModelManager
- returns a boolean matrix where each
(row, column) entry contains true if the
model has a legal transition between state row and state column.
A ModelManager may safely return null if all transitions are legal.
- Specified by:
getLegalTransitions in interface ModelManager
- Returns:
- a boolean matrix containing the legal transitions.