public class IgnoreCountsTrainer extends Object implements DistributionTrainer
| Modifier | Constructor and Description |
|---|---|
protected |
IgnoreCountsTrainer()
Constructor intended for sub-classes.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addCount(DistributionTrainerContext dtc,
AtomicSymbol sym,
double times)
Registers that sym was counted in this state.
|
void |
clearCounts(DistributionTrainerContext dtc)
Clears all of the counts to zero.
|
double |
getCount(DistributionTrainerContext dtc,
AtomicSymbol sym)
Get the current count for this state.
|
static IgnoreCountsTrainer |
getInstance()
Returns the global singleton instance of the IgnoreCountsTrainer.
|
void |
train(DistributionTrainerContext dtc,
double weight)
Trains the Distribution, given a null model.
|
protected IgnoreCountsTrainer()
public void addCount(DistributionTrainerContext dtc, AtomicSymbol sym, double times) 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 seentimes - 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)
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 addpublic void clearCounts(DistributionTrainerContext dtc)
DistributionTrainerclearCounts in interface DistributionTrainerpublic static IgnoreCountsTrainer getInstance()
Copyright © 2020 BioJava. All rights reserved.