|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectde.jstacs.scoringFunctions.AbstractNormalizableScoringFunction
public abstract class AbstractNormalizableScoringFunction
This class is the main part of any ScoreClassifier. It implements many methods of the interface NormalizableScoringFunction.
| Field Summary | |
|---|---|
protected AlphabetContainer |
alphabets
The AlphabetContainer of this NormalizableScoringFunction |
protected int |
length
The length of the modeled sequences. |
protected static Random |
r
This object can be used for drawing initial parameters. |
| Fields inherited from interface de.jstacs.scoringFunctions.ScoringFunction |
|---|
UNKNOWN |
| Constructor Summary | |
|---|---|
AbstractNormalizableScoringFunction(AlphabetContainer alphabets,
int length)
The main constructor. |
|
AbstractNormalizableScoringFunction(StringBuffer xml)
This is the constructor for Storable. |
|
| Method Summary | |
|---|---|
AbstractNormalizableScoringFunction |
clone()
Creates a clone (deep copy) of the current ScoringFunction instance. |
protected abstract void |
fromXML(StringBuffer xml)
This method is called in the constructor to create a scoring function from a StringBuffer |
AlphabetContainer |
getAlphabetContainer()
Returns the AlphabetContainer for this ScoringFunction. |
double |
getInitialClassParam(double classProb)
Returns the initial class parameter for the class this ScoringFunction is responsible for, based on the probability classProb. |
int |
getLength()
Returns the length of this ScoringFunction. i.e. the length of the Sequences this ScoringFunction can handle. |
double |
getLogScore(Sequence seq)
Returns the log score for the sequence |
double |
getLogScoreAndPartialDerivation(Sequence seq,
IntList indices,
DoubleList partialDer)
Returns the log score for the sequence and fills the list with the indices and the partial derivations. |
int |
getNumberOfRecommendedStarts()
This method return the number of recommended optimization starts. |
boolean |
isNormalized()
This method returns whether the implemented score is already normalized to 1. |
static boolean |
isNormalized(NormalizableScoringFunction... function)
This method checks whether all given NormalizableScoringFunctions are normalized. |
| 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, getLogPriorTerm, getNormalizationConstant, getPartialNormalizationConstant, getSizeOfEventSpaceForRandomVariablesOfParameter |
| Methods inherited from interface de.jstacs.scoringFunctions.ScoringFunction |
|---|
getCurrentParameterValues, getInstanceName, getLogScore, getLogScoreAndPartialDerivation, getNumberOfParameters, initializeFunction, initializeFunctionRandomly, isInitialized, setParameters |
| Methods inherited from interface de.jstacs.Storable |
|---|
toXML |
| Field Detail |
|---|
protected static final Random r
ScoringFunction.getCurrentParameterValues()protected AlphabetContainer alphabets
NormalizableScoringFunction
protected int length
| Constructor Detail |
|---|
public AbstractNormalizableScoringFunction(AlphabetContainer alphabets,
int length)
alphabets - the AlphabetContainer of this ScoringFunctionlength - the length of this ScoringFunction
public AbstractNormalizableScoringFunction(StringBuffer xml)
throws NonParsableException
Storable.
xml - the xml representation
NonParsableException - if the representation could not be parsed.| Method Detail |
|---|
public AbstractNormalizableScoringFunction clone()
throws CloneNotSupportedException
ScoringFunctionScoringFunction instance.
clone in interface ScoringFunctionclone in class ObjectCloneNotSupportedException
protected abstract void fromXML(StringBuffer xml)
throws NonParsableException
xml - the XML representation
NonParsableException - if the StringBuffer could not be parsed.public final AlphabetContainer getAlphabetContainer()
ScoringFunctionAlphabetContainer for this ScoringFunction.
Only Sequences with a comparable AlphabetContainer can be modeled.
getAlphabetContainer in interface ScoringFunctionpublic int getLength()
ScoringFunctionScoringFunction. i.e. the length of the Sequences this ScoringFunction can handle. For homogeneous ScoringFunction, i.e.
ScoringFunctions that support Sequences of different lengths, should return 0.
getLength in interface ScoringFunctionpublic final double getLogScore(Sequence seq)
getLogScore in interface ScoringFunctionseq - the sequence
public final double getLogScoreAndPartialDerivation(Sequence seq,
IntList indices,
DoubleList partialDer)
ScoringFunction
getLogScoreAndPartialDerivation in interface ScoringFunctionseq - the sequenceindices - after method invocation the list should contain the indices i where \frac{\partial \log
score(seq)}{\partial \lambda_i} is not zeropartialDer - after method invocation the list should contain the corresponding \frac{\partial \log
score(seq)}{\partial \lambda_i}
public int getNumberOfRecommendedStarts()
ScoringFunction
getNumberOfRecommendedStarts in interface ScoringFunctionpublic boolean isNormalized()
NormalizableScoringFunctionfalse.
isNormalized in interface NormalizableScoringFunctionpublic static boolean isNormalized(NormalizableScoringFunction... function)
function - the NormalizableScoringFunctions to be checked
true if all NormalizableScoringFunctions are already normalized, otherwise falseNormalizableScoringFunction.isNormalized()public double getInitialClassParam(double classProb)
ScoringFunctionScoringFunction is responsible for, based on the probability classProb.
getInitialClassParam in interface NormalizableScoringFunctiongetInitialClassParam in interface ScoringFunctionclassProb - the class probability
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||