public abstract class AbstractOptimizableFunction extends OptimizableFunction
OptimizableFunction
and implements some common
methods.OptimizableFunction.KindOfParameter
Modifier and Type | Field and Description |
---|---|
protected int |
cl
The number of different classes.
|
protected double[] |
clazz
The class parameters.
|
protected DataSet[] |
data
The data that is used to evaluate this function.
|
protected boolean |
freeParams
Indicates whether only the free parameters or all should be used.
|
protected double[] |
logClazz
The logarithm of the class parameters.
|
protected boolean |
norm
Indicates whether a normalization should be done or not.
|
protected double[] |
sum
The sums of the weighted data per class and additional the total weight
sum.
|
protected double[][] |
weights
The weights for the data.
|
Modifier | Constructor and Description |
---|---|
protected |
AbstractOptimizableFunction(DataSet[] data,
double[][] weights,
boolean norm,
boolean freeParams)
The constructor creates an instance using the given weighted data.
|
Modifier and Type | Method and Description |
---|---|
DataSet[] |
getData()
Returns the data for each class used in this
OptimizableFunction . |
double[] |
getParameters(OptimizableFunction.KindOfParameter kind)
Returns some parameters that can be used for instance as start
parameters.
|
abstract void |
getParameters(OptimizableFunction.KindOfParameter kind,
double[] erg)
This method enables the user to get the parameters without creating a new
array.
|
double[][] |
getSequenceWeights()
Returns the weights for each
Sequence for each
class used in this OptimizableFunction . |
void |
setDataAndWeights(DataSet[] data,
double[][] weights)
This method sets the data set and the sequence weights to be used.
|
reset, setParams
evaluateGradientOfFunction, findOneDimensionalMin
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
evaluateFunction, getDimensionOfScope
protected DataSet[] data
protected double[][] weights
data
protected double[] clazz
protected double[] logClazz
clazz
protected double[] sum
protected int cl
protected boolean norm
protected boolean freeParams
protected AbstractOptimizableFunction(DataSet[] data, double[][] weights, boolean norm, boolean freeParams) throws IllegalArgumentException
data
- the dataweights
- the weightsnorm
- the switch for using the normalization (division by the number
of sequences)freeParams
- the switch for using only the free parametersIllegalArgumentException
- if the number of classes or the dimension of the weights is not correctpublic void setDataAndWeights(DataSet[] data, double[][] weights) throws IllegalArgumentException
OptimizableFunction
setDataAndWeights
in class OptimizableFunction
data
- the data setsweights
- the sequence weights for each sequence in each data setIllegalArgumentException
- if the data or the weights can not be usedpublic abstract void getParameters(OptimizableFunction.KindOfParameter kind, double[] erg) throws Exception
kind
- the kind of the class parameters to be returned in
erg
erg
- the array for the start parametersException
- if the array is null
or does not have the
correct lengthOptimizableFunction.getParameters(KindOfParameter)
public final double[] getParameters(OptimizableFunction.KindOfParameter kind) throws Exception
OptimizableFunction
getParameters
in class OptimizableFunction
kind
- the kind of the class parameters that will be returnedException
- if something went wrongpublic DataSet[] getData()
OptimizableFunction
OptimizableFunction
.getData
in class OptimizableFunction
OptimizableFunction.getSequenceWeights()
public double[][] getSequenceWeights()
OptimizableFunction
Sequence
for each
class used in this OptimizableFunction
.getSequenceWeights
in class OptimizableFunction
Sequence
and each
classOptimizableFunction.getData()