|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectde.jstacs.scoringFunctions.AbstractNormalizableScoringFunction
de.jstacs.scoringFunctions.mix.motifSearch.PositionScoringFunction
public abstract class PositionScoringFunction
This class implements a position scoring function that enables the user to get a score without using a Sequence object. It furthermore implements a kind of iterator that allows the user to iterate over all reasonable possibilities.
Sequence,
reset(),
next(),
getLogScoreForInternal(),
getLogScoreAndPartialDerivationForInternal(IntList, DoubleList)| Field Summary | |
|---|---|
protected int[] |
internal
This array is used for some method of DurationScoringFunction that use an internal memory |
| Fields inherited from class de.jstacs.scoringFunctions.AbstractNormalizableScoringFunction |
|---|
alphabets, length, r |
| Fields inherited from interface de.jstacs.scoringFunctions.ScoringFunction |
|---|
UNKNOWN |
| Constructor Summary | |
|---|---|
protected |
PositionScoringFunction(AlphabetContainer con,
int length)
This constructor allows create instance with more than one dimension. |
protected |
PositionScoringFunction(int min,
int max)
This is the main constructor that creates the AlphabetContainer internally. |
protected |
PositionScoringFunction(StringBuffer source)
This is the constructor for Storable. |
| Method Summary | |
|---|---|
PositionScoringFunction |
clone()
Creates a clone (deep copy) of the current ScoringFunction
instance. |
protected void |
fromXML(StringBuffer xml)
This method is called in the constructor for the Storable
interface to create a scoring function from a StringBuffer. |
void |
getInternalPosition(int[] positions)
Copies the current value of the internal iterator in the given array. |
abstract double |
getLogScore(int... values)
This method enables the user to get the log-score without using a sequence object. |
double |
getLogScore(Sequence seq,
int start)
Returns the logarithmic score for the Sequence seq
beginning at position start in the Sequence. |
abstract double |
getLogScoreAndPartialDerivation(IntList indices,
DoubleList partialDer,
int... values)
This method enables the user to get the log-score and the partial derivations without using a sequence object. |
double |
getLogScoreAndPartialDerivation(Sequence seq,
int start,
IntList indices,
DoubleList partialDer)
Returns the logarithmic score for a Sequence beginning at
position start in the Sequence and fills lists with
the indices and the partial derivations. |
double |
getLogScoreAndPartialDerivationForInternal(IntList indices,
DoubleList partialDer)
This method enables the user to get the log-score and the partial derivations without using a sequence object by using the internal iterator. |
double |
getLogScoreForInternal()
This method enables the user to get the log-score without using a sequence object by using the internal iterator. |
protected int[] |
getValuesFromSequence(Sequence seq,
int start)
This method extracts the values form a sequence. |
abstract boolean |
isPossible(int... positions)
This method returns true if the given positions are in the domain of the
PositionScoringFunction. |
abstract boolean |
next()
This method steps to the next reasonable outcome if possible. |
abstract void |
reset()
This method resets the iterator to the initial state (first reasonable output) so that it can be used again. |
StringBuffer |
toXML()
This method returns an XML representation as StringBuffer of an
instance of the implementing class. |
| Methods inherited from class de.jstacs.scoringFunctions.AbstractNormalizableScoringFunction |
|---|
getAlphabetContainer, getInitialClassParam, getLength, getLogScore, getLogScoreAndPartialDerivation, getNumberOfRecommendedStarts, getNumberOfStarts, isNormalized, isNormalized |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface de.jstacs.scoringFunctions.NormalizableScoringFunction |
|---|
addGradientOfLogPriorTerm, getEss, getLogNormalizationConstant, getLogPartialNormalizationConstant, getLogPriorTerm, getSizeOfEventSpaceForRandomVariablesOfParameter |
| Methods inherited from interface de.jstacs.scoringFunctions.ScoringFunction |
|---|
getCurrentParameterValues, getInstanceName, getNumberOfParameters, initializeFunction, initializeFunctionRandomly, isInitialized, setParameters |
| Field Detail |
|---|
protected int[] internal
DurationScoringFunction that use an internal memory
DurationScoringFunction.reset(),
DurationScoringFunction.next(),
getInternalPosition(int[])| Constructor Detail |
|---|
protected PositionScoringFunction(AlphabetContainer con,
int length)
AlphabetContainer already exists.
con - the AlphabetContainerlength - the number of dimensions, e.g. the length of the modeled sequences
protected PositionScoringFunction(int min,
int max)
AlphabetContainer internally.
min - the minimal valuemax - the maximal value
protected PositionScoringFunction(StringBuffer source)
throws NonParsableException
Storable. Creates a new
DurationScoringFunction out of a StringBuffer.
source - the XML representation as StringBuffer
NonParsableException - if the XML representation could not be parsed| Method Detail |
|---|
public PositionScoringFunction clone()
throws CloneNotSupportedException
ScoringFunctionScoringFunction
instance.
clone in interface ScoringFunctionclone in class AbstractNormalizableScoringFunctionScoringFunction
CloneNotSupportedException - if something went wrong while cloning the
ScoringFunctionpublic abstract void reset()
public abstract boolean next()
true if a next reasonable outcome could be set, otherwise falsepublic void getInternalPosition(int[] positions)
positions - the array containing the internal positions after calling this methodpublic double getLogScoreForInternal()
public double getLogScoreAndPartialDerivationForInternal(IntList indices,
DoubleList partialDer)
indices - a list for the indices of the parameterspartialDer - a list of the partial derivations
public abstract double getLogScore(int... values)
values - the values
public abstract double getLogScoreAndPartialDerivation(IntList indices,
DoubleList partialDer,
int... values)
indices - a list for the indices of the parameterspartialDer - a list of the partial derivationsvalues - the values
public double getLogScore(Sequence seq,
int start)
ScoringFunctionSequence seq
beginning at position start in the Sequence.
seq - the Sequencestart - the start position in the Sequence
Sequence
public double getLogScoreAndPartialDerivation(Sequence seq,
int start,
IntList indices,
DoubleList partialDer)
ScoringFunctionSequence beginning at
position start in the Sequence and fills lists with
the indices and the partial derivations.
seq - the Sequencestart - the start position in the Sequenceindices - an IntList of indices, after method invocation the
list should contain the indices i where
is not zeropartialDer - a DoubleList of partial derivations, after method
invocation the list should contain the corresponding
that are not zero
Sequence
protected int[] getValuesFromSequence(Sequence seq,
int start)
seq - the sequencestart - the index of the startposition
public abstract boolean isPossible(int... positions)
true if the given positions are in the domain of the
PositionScoringFunction.
positions - the positions to be tested
true if the given positions are in the domain of the
PositionScoringFunctionpublic StringBuffer toXML()
StorableStringBuffer of an
instance of the implementing class.
protected void fromXML(StringBuffer xml)
throws NonParsableException
AbstractNormalizableScoringFunctionStorable
interface to create a scoring function from a StringBuffer.
fromXML in class AbstractNormalizableScoringFunctionxml - the XML representation as StringBuffer
NonParsableException - if the StringBuffer could not be parsedAbstractNormalizableScoringFunction.AbstractNormalizableScoringFunction(StringBuffer)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||