|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.jstacs.algorithms.optimization.DifferentiableFunction
de.jstacs.classifier.scoringFunctionBased.OptimizableFunction
de.jstacs.classifier.scoringFunctionBased.cll.NormConditionalLogLikelihood
public class NormConditionalLogLikelihood
This class implements the normalized log conditional likelihood. It can be used to maximize the parameters.
Constructor Summary | |
---|---|
NormConditionalLogLikelihood(ScoringFunction[] score,
Sample[] data,
double[][] weights,
boolean norm,
boolean freeParams)
The constructor creates an instance of the log conditional likelihood. |
|
NormConditionalLogLikelihood(ScoringFunction[] score,
Sample[] data,
double[][] weights,
LogPrior prior,
boolean norm,
boolean freeParams)
The constructor creates an instance using the given prior. |
Method Summary | |
---|---|
double |
evaluateFunction(double[] x)
Evaluates the function at a certain vector (in mathematical sense) x |
double[] |
evaluateGradientOfFunction(double[] x)
Evaluates the gradient of function at a certain vector (in mathematical sense) x |
double[] |
getClassParams(double[] params)
Returns from the complete vector of parameters those that are for the classes. |
int |
getDimensionOfScope()
Returns the dimension of the scope of the function. |
int |
getNumberOfStarts()
Returns the number of starts that should be done for a good optimum. |
double[] |
getStartParams(boolean plugIn)
Returns some start parameters. |
void |
getStartParams(boolean plugIn,
double[] erg)
This method enables the user to get the start parameters without creating a new array. |
void |
reset(ScoringFunction[] funs)
Resets the scoringFunctions and all precomputed values. |
void |
setParams(double[] params)
Sets the current values as parameters |
Methods inherited from class de.jstacs.algorithms.optimization.DifferentiableFunction |
---|
findOneDimensionalMin |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public NormConditionalLogLikelihood(ScoringFunction[] score, Sample[] data, double[][] weights, boolean norm, boolean freeParams) throws IllegalArgumentException, WrongAlphabetException
score
- the ScoringFunctionsdata
- the dataweights
- the weightsnorm
- the switch for using the normalization (division by the number of sequences)freeParams
- the switch for using only the free parameters
IllegalArgumentException
WrongAlphabetException
public NormConditionalLogLikelihood(ScoringFunction[] score, Sample[] data, double[][] weights, LogPrior prior, boolean norm, boolean freeParams) throws IllegalArgumentException, WrongAlphabetException
score
- the ScoringFunctionsdata
- the dataweights
- the weightsprior
- the priornorm
- the switch for using the normalization (division by the number of sequences)freeParams
- the switch for using only the free parameters
IllegalArgumentException
WrongAlphabetException
Method Detail |
---|
public double[] evaluateGradientOfFunction(double[] x) throws DimensionException, EvaluationException
DifferentiableFunction
x
evaluateGradientOfFunction
in class DifferentiableFunction
x
- the current vector
getDimensionOfScope()
DimensionException
- if dim(x) != n, with f: R^n -> R
EvaluationException
- if there was a mistake in evaluating the gradientFunction.getDimensionOfScope()
public double evaluateFunction(double[] x) throws DimensionException, EvaluationException
Function
x
x
- the current vector
DimensionException
- if dim(x) != n, with f: R^n -> R
EvaluationException
- if there was a mistake in evaluating the functionpublic int getDimensionOfScope()
Function
public void getStartParams(boolean plugIn, double[] erg) throws Exception
plugIn
- a switch to decide whether to used plug-in parameters or noterg
- the array for the start parameters
Exception
- if the array is null or does not have the correct lengthgetStartParams(boolean)
public double[] getStartParams(boolean plugIn) throws Exception
OptimizableFunction
getStartParams
in class OptimizableFunction
plugIn
- if some special parameters should be used as plug in parameter (e.g. MAP-parameters)
Exception
- if something went wrongpublic void setParams(double[] params) throws DimensionException
OptimizableFunction
setParams
in class OptimizableFunction
params
- the current values
DimensionException
- if the dimension of the current values does not match with the internal parameterspublic double[] getClassParams(double[] params)
OptimizableFunction
getClassParams
in class OptimizableFunction
params
- the current params
public int getNumberOfStarts()
OptimizableFunction
getNumberOfStarts
in class OptimizableFunction
Optimizer
public void reset(ScoringFunction[] funs) throws Exception
OptimizableFunction
reset
in class OptimizableFunction
funs
- the array of scoringFunctions
Exception
- if something went wrong
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |