|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Encapsulates the training of an entire model.
Method Summary | |
void |
addTransitionCount(State from,
State to,
double count)
Adds some counts to the transition between two states. |
void |
clearCounts()
Clears all of the counts, ready for re-training. |
TransitionTrainer |
getTrainerForModel(MarkovModel model)
Retrieve the TransitionTrainer associated with a model, or null if none is registered. |
void |
registerTrainerForModel(MarkovModel model,
TransitionTrainer trainer)
Register a trainer as being for a model. |
void |
registerTrainerForTransition(State from,
State to,
TransitionTrainer trainer,
State source,
State destination)
Register a TransitionTrainer, a source and a destination state with a pair of states. |
void |
train()
Trains up the transitions in this model with the counts so far. |
java.util.Set |
trainersForTransition(State from,
State to)
Retrieves a Set of TransitionTrainers associated with a transition between a pair of states. |
Methods inherited from interface org.biojava.bio.dist.DistributionTrainerContext |
addCount,
clearDistributionCounts,
getDistributionTrainer,
registerDistribution,
registerDistributionTrainer,
trainDistributions |
Method Detail |
public void addTransitionCount(State from, State to, double count) throws IllegalSymbolException, IllegalTransitionException
from
- the source of the transitionto
- the destination of the transitioncounts
- how many counts to addpublic void train() throws IllegalSymbolException, IllegalTransitionException
This method should not throw any exceptions. I am considering making this much tighter now that we have the vetoable mutator methods.
public void clearCounts()
public void registerTrainerForTransition(State from, State to, TransitionTrainer trainer, State source, State destination) throws BioException
More than one TransitionTrainer and source, destination pairs may be associated with a pair of states, in which case counts will be added to each trainer and source, destination.
The TransitionTrainer must have been added previously using registerTrainerForModel.
from
- the source state of the observed transitionto
- the destination state of the observed transitiontrainer
- the TransitionTrainer to add to the list of trainerssource
- the source state for the trainerdestination
- the destination state for the trainerpublic java.util.Set trainersForTransition(State from, State to)
Do not change the fields of the TrainerTransition objects in the returned Set, and do not change the Set.
from
- the source stateto
- the destination statepublic TransitionTrainer getTrainerForModel(MarkovModel model)
public void registerTrainerForModel(MarkovModel model, TransitionTrainer trainer) throws BioException
model
- the MarkovModel to traintrainer
- the trainer that will train the model
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |