|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.jstacs.sequenceScores.differentiable.AbstractDifferentiableSequenceScore
public abstract class AbstractDifferentiableSequenceScore
This class is the main part of any ScoreClassifier
. It implements
many methods of the interface DifferentiableSequenceScore
.
Field Summary | |
---|---|
protected AlphabetContainer |
alphabets
The AlphabetContainer of this AbstractDifferentiableSequenceScore
. |
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.sequenceScores.differentiable.DifferentiableSequenceScore |
---|
UNKNOWN |
Constructor Summary | |
---|---|
AbstractDifferentiableSequenceScore(AlphabetContainer alphabets,
int length)
The main constructor. |
|
AbstractDifferentiableSequenceScore(StringBuffer xml)
This is the constructor for Storable . |
Method Summary | |
---|---|
AbstractDifferentiableSequenceScore |
clone()
Creates a clone (deep copy) of the current DifferentiableSequenceScore
instance. |
protected abstract void |
fromXML(StringBuffer xml)
This method is called in the constructor for the Storable
interface to create a scoring function from a StringBuffer . |
AlphabetContainer |
getAlphabetContainer()
Returns the container of alphabets that were used when constructing the instance. |
ResultSet |
getCharacteristics()
Returns some information characterizing or describing the current instance. |
double |
getInitialClassParam(double classProb)
Returns the initial class parameter for the class this DifferentiableSequenceScore is responsible for, based on the class
probability classProb . |
int |
getLength()
Returns the length of sequences this instance can score. |
double |
getLogScoreAndPartialDerivation(Sequence seq,
int startpos,
int endpos,
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. |
double[] |
getLogScoreFor(DataSet data)
This method computes the logarithm of the scores of all sequences in the given sample. |
void |
getLogScoreFor(DataSet data,
double[] res)
This method computes and stores the logarithm of the scores for any sequence in the sample in the given double -array. |
double |
getLogScoreFor(Sequence seq)
Returns the logarithmic score for the Sequence seq . |
double |
getLogScoreFor(Sequence seq,
int startpos,
int endpos)
Returns the logarithmic score for the Sequence seq
beginning at position start in the Sequence . |
int |
getNumberOfRecommendedStarts()
This method returns the number of recommended optimization starts. |
static int |
getNumberOfStarts(DifferentiableSequenceScore[] score)
Returns the number of recommended starts in a numerical optimization. |
NumericalResultSet |
getNumericalCharacteristics()
Returns the subset of numerical values that are also returned by SequenceScore.getCharacteristics() . |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface de.jstacs.sequenceScores.differentiable.DifferentiableSequenceScore |
---|
getCurrentParameterValues, getLogScoreAndPartialDerivation, getNumberOfParameters, initializeFunction, initializeFunctionRandomly, setParameters |
Methods inherited from interface de.jstacs.sequenceScores.SequenceScore |
---|
getInstanceName, getLogScoreFor, isInitialized |
Methods inherited from interface de.jstacs.Storable |
---|
toXML |
Field Detail |
---|
protected static final Random r
DifferentiableSequenceScore.getCurrentParameterValues()
protected AlphabetContainer alphabets
AlphabetContainer
of this AbstractDifferentiableSequenceScore
.
protected int length
Constructor Detail |
---|
public AbstractDifferentiableSequenceScore(AlphabetContainer alphabets, int length) throws IllegalArgumentException
alphabets
- the AlphabetContainer
of this DifferentiableSequenceScore
length
- the length of this DifferentiableSequenceScore
, i.e. the length of
the modeled sequences
IllegalArgumentException
- if the length is negative or does not match with AlphabetContainer.getPossibleLength()
public AbstractDifferentiableSequenceScore(StringBuffer xml) throws NonParsableException
Storable
. Creates a new
AbstractDifferentiableSequenceScore
out of a StringBuffer
.
xml
- the XML representation as StringBuffer
NonParsableException
- if the XML representation could not be parsedMethod Detail |
---|
public static final int getNumberOfStarts(DifferentiableSequenceScore[] score)
score
- the scoring functions
DifferentiableSequenceScore.getNumberOfRecommendedStarts()
public AbstractDifferentiableSequenceScore clone() throws CloneNotSupportedException
DifferentiableSequenceScore
DifferentiableSequenceScore
instance.
clone
in interface DifferentiableSequenceScore
clone
in interface SequenceScore
clone
in class Object
DifferentiableSequenceScore
CloneNotSupportedException
- if something went wrong while cloning the
DifferentiableSequenceScore
protected abstract void fromXML(StringBuffer xml) throws NonParsableException
Storable
interface to create a scoring function from a StringBuffer
.
xml
- the XML representation as StringBuffer
NonParsableException
- if the StringBuffer
could not be parsedAbstractDifferentiableSequenceScore(StringBuffer)
public final AlphabetContainer getAlphabetContainer()
SequenceScore
getAlphabetContainer
in interface SequenceScore
public int getLength()
SequenceScore
getLength
in interface SequenceScore
public final double getLogScoreFor(Sequence seq)
SequenceScore
Sequence
seq
.
getLogScoreFor
in interface SequenceScore
seq
- the sequence
public double getLogScoreFor(Sequence seq, int startpos, int endpos) throws WrongLengthException
SequenceScore
Sequence
seq
beginning at position start
in the Sequence
.
getLogScoreFor
in interface SequenceScore
seq
- the Sequence
startpos
- the start position in the Sequence
endpos
- the end position (inclusive) in the Sequence
Sequence
WrongLengthException
public final double getLogScoreAndPartialDerivation(Sequence seq, IntList indices, DoubleList partialDer)
DifferentiableSequenceScore
Sequence
seq
and
fills lists with the indices and the partial derivations.
getLogScoreAndPartialDerivation
in interface DifferentiableSequenceScore
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
public double getLogScoreAndPartialDerivation(Sequence seq, int startpos, int endpos, IntList indices, DoubleList partialDer) throws WrongLengthException
DifferentiableSequenceScore
Sequence
beginning at
position start
in the Sequence
and fills lists with
the indices and the partial derivations.
getLogScoreAndPartialDerivation
in interface DifferentiableSequenceScore
seq
- the Sequence
startpos
- the start position in the Sequence
endpos
- the end position (inclusive) 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
WrongLengthException
public int getNumberOfRecommendedStarts()
DifferentiableSequenceScore
getNumberOfRecommendedStarts
in interface DifferentiableSequenceScore
public double getInitialClassParam(double classProb)
DifferentiableSequenceScore
DifferentiableSequenceScore
is responsible for, based on the class
probability classProb
.
getInitialClassParam
in interface DifferentiableSequenceScore
classProb
- the class probability
public double[] getLogScoreFor(DataSet data) throws Exception
SequenceScore
SequenceScore.getLogScoreFor(Sequence)
.
getLogScoreFor
in interface SequenceScore
data
- the sample of sequences
Exception
- if something went wrongSequenceScore.getLogScoreFor(Sequence)
public void getLogScoreFor(DataSet data, double[] res) throws Exception
SequenceScore
double
-array.
SequenceScore.getLogScoreFor(Sequence)
.
getLogScoreFor
in interface SequenceScore
data
- the sample of sequencesres
- the array for the results, has to have length
data.getNumberOfElements()
(which returns the
number of sequences in the sample)
Exception
- if something went wrongSequenceScore.getLogScoreFor(Sequence)
,
SequenceScore.getLogScoreFor(DataSet)
public ResultSet getCharacteristics() throws Exception
SequenceScore
StorableResult
.
getCharacteristics
in interface SequenceScore
Exception
- if some of the characteristics could not be definedStorableResult
public NumericalResultSet getNumericalCharacteristics() throws Exception
SequenceScore
SequenceScore.getCharacteristics()
.
getNumericalCharacteristics
in interface SequenceScore
Exception
- if some of the characteristics could not be defined
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |