|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface ScoringFunction
This interface is the main part of any ScoreClassifier.
| Field Summary | |
|---|---|
static int |
UNKNOWN
Indicates that the number of parameters of this ScoringFunction
is not known (yet). |
| Method Summary | |
|---|---|
ScoringFunction |
clone()
Creates a clone (deep copy) of the current ScoringFunction
instance. |
AlphabetContainer |
getAlphabetContainer()
Returns the AlphabetContainer for this ScoringFunction. |
double[] |
getCurrentParameterValues()
Returns a double array of dimension
getNumberOfParameters() containing the current parameter values. |
double |
getInitialClassParam(double classProb)
Returns the initial class parameter for the class this ScoringFunction is responsible for, based on the class
probability classProb. |
String |
getInstanceName()
Returns a short instance name. |
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 logarithmic score for the Sequence seq. |
double |
getLogScore(Sequence seq,
int start)
Returns the logarithmic score for the Sequence seq
beginning at position start in the Sequence. |
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 |
getLogScoreAndPartialDerivation(Sequence seq,
IntList indices,
DoubleList partialDer)
Returns the logarithmic score for a Sequence seq and
fills lists with the indices and the partial derivations. |
int |
getNumberOfParameters()
Returns the number of parameters in this ScoringFunction. |
int |
getNumberOfRecommendedStarts()
This method returns the number of recommended optimization starts. |
void |
initializeFunction(int index,
boolean freeParams,
Sample[] data,
double[][] weights)
This method creates the underlying structure of the ScoringFunction. |
void |
initializeFunctionRandomly(boolean freeParams)
This method initializes the ScoringFunction randomly. |
boolean |
isInitialized()
This method can be used to determine whether the model is initialized. |
void |
setParameters(double[] params,
int start)
This method sets the internal parameters to the values of params between start and
start + |
| Methods inherited from interface de.jstacs.Storable |
|---|
toXML |
| Field Detail |
|---|
static final int UNKNOWN
ScoringFunction
is not known (yet).
| Method Detail |
|---|
ScoringFunction clone()
throws CloneNotSupportedException
ScoringFunction
instance.
ScoringFunction
CloneNotSupportedException - if something went wrong while cloning the
ScoringFunction
void initializeFunction(int index,
boolean freeParams,
Sample[] data,
double[][] weights)
throws Exception
ScoringFunction.
index - the index of the class the ScoringFunction modelsfreeParams - indicates whether the (reduced) parameterization is useddata - the samplesweights - the weights of the sequences in the samples
Exception - if something went wrong
void initializeFunctionRandomly(boolean freeParams)
throws Exception
ScoringFunction randomly. It has to
create the underlying structure of the ScoringFunction.
freeParams - indicates whether the (reduced) parameterization is used
Exception - if something went wrongAlphabetContainer getAlphabetContainer()
AlphabetContainer for this ScoringFunction.
Only Sequences with a comparable AlphabetContainer can be
modeled.
AlphabetContainerString getInstanceName()
int getLength()
ScoringFunction, i.e. the length of
the Sequences this ScoringFunction can handle. For
homogeneous ScoringFunctions, i.e. ScoringFunctions that
support Sequences of different lengths, the method should return
0.
ScoringFunctiondouble getLogScore(Sequence seq)
Sequence seq.
seq - the sequence
double getLogScore(Sequence seq,
int start)
Sequence seq
beginning at position start in the Sequence.
seq - the Sequencestart - the start position in the Sequence
Sequence
double getLogScoreAndPartialDerivation(Sequence seq,
IntList indices,
DoubleList partialDer)
Sequence seq and
fills lists with the indices and the partial derivations.
seq - 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
double getLogScoreAndPartialDerivation(Sequence seq,
int start,
IntList indices,
DoubleList partialDer)
Sequence 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
Sequenceint getNumberOfParameters()
ScoringFunction. If the
number of parameters is not known yet, the method returns
UNKNOWN.
ScoringFunctionUNKNOWNint getNumberOfRecommendedStarts()
double[] getCurrentParameterValues()
throws Exception
double array of dimension
getNumberOfParameters() containing the current parameter values.
If one likes to use these parameters to start an optimization it is
highly recommended to invoke
initializeFunction(int, boolean, Sample[], double[][]) before.
After an optimization this method can be used to get the current
parameter values.
Exception - if no parameters exist (yet)
void setParameters(double[] params,
int start)
params between start and
start + getNumberOfParameters() - 1
params - the new parametersstart - the start index in paramsboolean isInitialized()
initializeFunction(int, boolean, Sample[], double[][]).
true if the model is initialized, false
otherwisedouble getInitialClassParam(double classProb)
ScoringFunction is responsible for, based on the class
probability classProb.
classProb - the class probability
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||