|
||||||||||
| 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 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 log score for the sequence |
double |
getLogScore(Sequence seq,
int start)
Returns the log score for the sequence |
double |
getLogScoreAndPartialDerivation(Sequence seq,
int start,
IntList indices,
DoubleList partialDer)
Returns the log score for the sequence and fills the list with the indices and the partial derivations. |
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 |
getNumberOfParameters()
The number of parameters in this scoring function. |
int |
getNumberOfRecommendedStarts()
This method return the number of recommended optimization starts. |
void |
initializeFunction(int index,
boolean freeParams,
Sample[] data,
double[][] weights)
This method creates the underlying structure of the scoring function. |
void |
initializeFunctionRandomly(boolean freeParams)
This method initializes the scoring function 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 + this.getNumberOfParameters() - 1 |
| 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.
CloneNotSupportedException
void initializeFunction(int index,
boolean freeParams,
Sample[] data,
double[][] weights)
throws Exception
index - the index of the class the scoring function modelsfreeParams - if true, the (reduced) parameterization is useddata - the samplesweights - the weights of the sequences in the samples
- Throws:
Exception
void initializeFunctionRandomly(boolean freeParams)
throws Exception
freeParams - if true, the (reduced) parameterization is used
ExceptionAlphabetContainer getAlphabetContainer()
AlphabetContainer for this ScoringFunction.
Only Sequences with a comparable AlphabetContainer can be modeled.
String getInstanceName()
int getLength()
ScoringFunction. 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.
double getLogScore(Sequence seq)
seq - the sequence
double getLogScore(Sequence seq,
int start)
seq - the sequencestart - the startposition in the sequence
double getLogScoreAndPartialDerivation(Sequence seq,
IntList indices,
DoubleList partialDer)
seq - 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}
double getLogScoreAndPartialDerivation(Sequence seq,
int start,
IntList indices,
DoubleList partialDer)
seq - the sequencestart - the startposition in 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}
int getNumberOfParameters()
UNKNOWN.
UNKNOWNint getNumberOfRecommendedStarts()
double[] getCurrentParameterValues()
throws Exception
getNumberOfParameters() containing the current parameter
values. If on e 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 - is thrown if no parameters exist, yet
void setParameters(double[] params,
int start)
params between start and
start + this.getNumberOfParameters() - 1
params - the parametersstart - the start indexboolean isInitialized()
initializeFunction(int, boolean, Sample[], double[][]).
true if the model is initializeddouble getInitialClassParam(double classProb)
ScoringFunction is responsible for, based on the probability classProb.
classProb - the class probability
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||