|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.mahout.classifier.sequencelearning.hmm.HmmModel
public class HmmModel
Main class defining a Hidden Markov Model
Constructor Summary | |
---|---|
HmmModel(int nrOfHiddenStates,
int nrOfOutputStates)
Construct a valid random Hidden-Markov parameter set with the given number of hidden and output states. |
|
HmmModel(int nrOfHiddenStates,
int nrOfOutputStates,
long seed)
Construct a valid random Hidden-Markov parameter set with the given number of hidden and output states using a given seed. |
|
HmmModel(Matrix transitionMatrix,
Matrix emissionMatrix,
Vector initialProbabilities)
Generates a Hidden Markov model using the specified parameters |
Method Summary | |
---|---|
void |
assign(HmmModel model)
Assign the content of another HMM model to this one |
HmmModel |
clone()
Get a copy of this model |
Matrix |
getEmissionMatrix()
Getter function to get the output state probability matrix |
int |
getHiddenStateID(String name)
Lookup the ID for the given hidden state name |
String |
getHiddenStateName(int id)
Lookup the name for the given hidden state ID |
Map<String,Integer> |
getHiddenStateNames()
Getter method for the hidden state Names map |
Vector |
getInitialProbabilities()
Getter function to return the vector of initial hidden state probabilities |
int |
getNrOfHiddenStates()
Getter Method for the number of hidden states |
int |
getNrOfOutputStates()
Getter Method for the number of output states |
int |
getOutputStateID(String name)
Lookup the ID for the given output state name |
String |
getOutputStateName(int id)
Lookup the name for the given output state id |
Map<String,Integer> |
getOutputStateNames()
Getter method for the output state Names map |
Matrix |
getTransitionMatrix()
Getter function to get the hidden state transition matrix |
void |
registerHiddenStateNames(Map<String,Integer> stateNames)
Register a map of hidden state Names/state IDs |
void |
registerHiddenStateNames(String[] stateNames)
Register an array of hidden state Names. |
void |
registerOutputStateNames(Map<String,Integer> stateNames)
Register a map of hidden state Names/state IDs |
void |
registerOutputStateNames(String[] stateNames)
Register an array of hidden state Names. |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public HmmModel(int nrOfHiddenStates, int nrOfOutputStates, long seed)
nrOfHiddenStates
- Number of hidden statesnrOfOutputStates
- Number of output statesseed
- Seed for the random initialization, if set to 0 the current time
is usedpublic HmmModel(int nrOfHiddenStates, int nrOfOutputStates)
nrOfHiddenStates
- Number of hidden statesnrOfOutputStates
- Number of output statespublic HmmModel(Matrix transitionMatrix, Matrix emissionMatrix, Vector initialProbabilities)
transitionMatrix
- transition probabilities.emissionMatrix
- emission probabilities.initialProbabilities
- initial start probabilities.
IllegalArgumentException
- If the given parameter set is invalidMethod Detail |
---|
public HmmModel clone()
clone
in class Object
public void assign(HmmModel model)
model
- The HmmModel that will be assigned to this onepublic int getNrOfHiddenStates()
public int getNrOfOutputStates()
public Matrix getTransitionMatrix()
public Matrix getEmissionMatrix()
public Vector getInitialProbabilities()
public Map<String,Integer> getHiddenStateNames()
public void registerHiddenStateNames(String[] stateNames)
stateNames
- names of hidden states.public void registerHiddenStateNames(Map<String,Integer> stateNames)
stateNames
- public String getHiddenStateName(int id)
id
- Integer id of the hidden state
public int getHiddenStateID(String name)
name
- Name of the hidden state
public Map<String,Integer> getOutputStateNames()
public void registerOutputStateNames(String[] stateNames)
stateNames
- state names to register.public void registerOutputStateNames(Map<String,Integer> stateNames)
stateNames
- public String getOutputStateName(int id)
id
- Integer id of the output state
public int getOutputStateID(String name)
name
- Name of the output state
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |