public final class SimpleDistributionTrainer extends Object implements DistributionTrainer, Serializable
This requires the distribuiton being trained to have a working setWeight method that doesn't throw an UnsupportedOperationExcepiton.
| Constructor and Description |
|---|
SimpleDistributionTrainer(Distribution dis)
Deprecated.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addCount(DistributionTrainerContext dtc,
AtomicSymbol sym,
double count)
Deprecated.
Registers that sym was counted in this state.
|
void |
clearCounts(DistributionTrainerContext dtc)
Deprecated.
Clears all of the counts to zero.
|
double |
getCount(DistributionTrainerContext dtc,
AtomicSymbol sym)
Deprecated.
Get the current count for this state.
|
void |
train(DistributionTrainerContext dtc,
double weight)
Deprecated.
Trains the Distribution, given a null model.
|
public SimpleDistributionTrainer(Distribution dis) throws IllegalAlphabetException
IllegalAlphabetExceptionpublic void addCount(DistributionTrainerContext dtc, AtomicSymbol sym, double count) throws IllegalSymbolException
DistributionTrainerRegisters 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 DistributionTrainerdtc - the DistributionTrainerContext within which the count was addedsym - the Symbol seencount - the number of times to addIllegalSymbolException - if sym is not recognisedpublic double getCount(DistributionTrainerContext dtc, AtomicSymbol sym) throws IllegalSymbolException
DistributionTrainerGet the current count for this state.
This method may be called multiple times with the same symbol. Each time it should return the agregate of the counts added with addCount since the last invocation of clearCounts.
getCount in interface DistributionTrainerdtc - the DistributionTrainerContext within which the count was addedsym - the Symbol seenIllegalSymbolException - if sym is not recognisedpublic void train(DistributionTrainerContext dtc, double weight) throws ChangeVetoException
DistributionTrainerTrains 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.
This method should not modify the underlying counts.
train in interface DistributionTrainerdtc - the context to useweight - how many lots of the null model to addChangeVetoException - if the distribution could not have its weights
modifiedpublic void clearCounts(DistributionTrainerContext dtc)
DistributionTrainerclearCounts in interface DistributionTrainerCopyright © 2020 BioJava. All rights reserved.