|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.biojava.bio.dist.SimpleDistributionTrainerContext | +--org.biojava.bio.dp.SimpleModelTrainer
Constructor Summary | |
SimpleModelTrainer(MarkovModel model,
Distribution nullModel,
double nullModelWeight,
double transCounts,
double transCountWeight)
Create a model trainer for a particular 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. |
java.util.Set |
getAllTransitionTrainers()
|
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 class org.biojava.bio.dist.SimpleDistributionTrainerContext |
addCount,
clearDistributionCounts,
getDistributionTrainer,
getNullModel,
getNullModelWeight,
registerDistribution,
registerDistributionTrainer,
setNullModel,
setNullModelWeight,
trainDistributions |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Constructor Detail |
public SimpleModelTrainer(MarkovModel model, Distribution nullModel, double nullModelWeight, double transCounts, double transCountWeight) throws BioException
model
- the MarkovModel to trainnullModel
- the null state model - possibly nullnullModelWeight
- how many times to add the null modeltransCounts
- the counts to add to each transitiontransCountWeight
- how many times to add themMethod 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 java.util.Set getAllTransitionTrainers()
public 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 |