|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
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 Sequence s 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 wrongvoid 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 Sequence
s with a comparable AlphabetContainer
can be
modeled.
AlphabetContainer
String getInstanceName()
int getLength()
ScoringFunction
, i.e. the length of
the Sequence
s this ScoringFunction
can handle. For
homogeneous ScoringFunction
s, i.e. ScoringFunction
s that
support Sequence
s of different lengths, the method should return
0
.
ScoringFunction
double 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 Sequence
start
- 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 Sequence
indices
- an IntList
of indices, after method invocation the
list should contain the indices i
where
partialDer
- a DoubleList
of partial derivations, after method
invocation the list should contain the corresponding
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 Sequence
start
- the start position in the Sequence
indices
- an IntList
of indices, after method invocation the
list should contain the indices i where
partialDer
- a DoubleList
of partial derivations, after method
invocation the list should contain the corresponding
Sequence
int getNumberOfParameters()
ScoringFunction
. If the
number of parameters is not known yet, the method returns
UNKNOWN
.
ScoringFunction
UNKNOWN
int 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 params
boolean 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 All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |