|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object | +--org.biojava.bio.dist.SimpleDistributionTrainerContext
A no-frills implementation of DistributionTrainerContext.
| Constructor Summary | |
SimpleDistributionTrainerContext()
|
|
| Method Summary | |
void |
addCount(Distribution dist,
Symbol sym,
double times)
Registers that sym was counted in this state. |
void |
clearCounts()
Clears all of the counts to zero. |
double |
getCount(Distribution dist,
Symbol sym)
Return the number of counts of a particular symbol which will be used to train the specified distribution. |
double |
getNullModelWeight()
Retrieve the weight of the background distribution |
DistributionTrainer |
getTrainer(Distribution dist)
Return the Distribution trainer object from the current context. |
void |
registerDistribution(Distribution dist)
Register a distribution object with this context. |
void |
registerTrainer(Distribution dist,
DistributionTrainer trainer)
Register a Distribution and an associated DistributionTrainer object. |
void |
setNullModelWeight(double nullModelWeight)
Assign a weight to the background distribution |
void |
train()
Trains the Distribution, given a null model. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public SimpleDistributionTrainerContext()
| Method Detail |
public double getNullModelWeight()
getNullModelWeight in interface DistributionTrainerContextpublic void setNullModelWeight(double nullModelWeight)
setNullModelWeight in interface DistributionTrainerContextnullModelWeight - the weight of the null model to assign.public void registerDistribution(Distribution dist)
DistributionTrainerContextRegister a distribution object with this context.
This method is a request to the context to register dist. If dist is already registered then this method should do nothing. If it is not registered, then it should invoke dist.registerWithTrainer
registerDistribution in interface DistributionTrainerContextdist - the Distribution to register
public void registerTrainer(Distribution dist,
DistributionTrainer trainer)
DistributionTrainerContextRegister a Distribution and an associated DistributionTrainer object.
In the registerWithTrainer method of a Distribution, it should associate itself with a trainer using this method.
registerTrainer in interface DistributionTrainerContextdist - the distribution to be registered.trainer - the distribution's trainer object to be registered.public DistributionTrainer getTrainer(Distribution dist)
DistributionTrainerContext
getTrainer in interface DistributionTrainerContextdist - the Distribution whose trainer is required.
public void addCount(Distribution dist,
Symbol sym,
double times)
throws IllegalSymbolException
DistributionTrainerContextRegisters that sym was counted in this state.
This method may be called multiple times with the same symbol. In this case, the times should be summed.
addCount in interface DistributionTrainerContextdist - the Distribution that the symbol was associated withsym - the Symbol seentimes - the number of times to add
IllegalSymbolException
public double getCount(Distribution dist,
Symbol sym)
throws IllegalSymbolException
DistributionTrainerContext
getCount in interface DistributionTrainerContextIllegalSymbolException
public void train()
throws ChangeVetoException
DistributionTrainerContextTrains the Distribution, given a null model.
This will use the information collected with multiple addCount calls, and the null model to generate the new weights.
train in interface DistributionTrainerContextChangeVetoException - if any of the distributions can't be trainedpublic void clearCounts()
DistributionTrainerContext
clearCounts in interface DistributionTrainerContext
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||