|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.jstacs.motifDiscovery.MotifDiscovererToolBox
de.jstacs.motifDiscovery.MutableMotifDiscovererToolbox
public final class MutableMotifDiscovererToolbox
This class contains some important methods for the initiation and optimization of MutableMotifDiscoverer
.
Nested Class Summary | |
---|---|
static class |
MutableMotifDiscovererToolbox.InitMethodForScoringFunction
This enum defines some constants for the method getSortedInitialParameters(Sample[], ScoringFunction[], InitMethodForScoringFunction[], OptimizableFunction, int, SafeOutputStream) . |
Constructor Summary | |
---|---|
MutableMotifDiscovererToolbox()
|
Method Summary | |
---|---|
static void |
clearHistoryArray(History[][] history)
This method clears all elements of an History-array, so that it can be used again. |
static History[][] |
createHistoryArray(ScoringFunction[] funs,
History template)
This method creates a History-array that can be used in an optimization. |
static int[][] |
createMinimalNewLengthArray(ScoringFunction[] funs)
This method creates a minimalNewLength-array that can be used in an optimization. |
static boolean |
doHeuristicSteps(ScoringFunction[] funs,
Sample[] data,
double[][] weights,
OptimizableFunction opt,
SafeOutputStream out,
boolean breakOnChanged,
History[][] hist,
int[][] minimalNewLength)
This method tries to make some heuristic step if at least one MutableMotifDiscovererToolbox.InitMethodForScoringFunction is a MutableMotifDiscoverer . |
static Sequence |
enumerate(Sample[] data,
ScoringFunction[] funs,
int classIndex,
int motifIndex,
double weight,
OptimizableFunction opt,
OutputStream out)
This method allows to enumerate all possible seeds for a motif in the HiddenMotifsMixture of a specific class. |
static ComparableElement<double[],Double>[] |
getSortedInitialParameters(Sample[] data,
ScoringFunction[] funs,
MutableMotifDiscovererToolbox.InitMethodForScoringFunction[] init,
OptimizableFunction opt,
int n,
SafeOutputStream stream)
This method allows to initialize the MutableMotifDiscovererToolbox.InitMethodForScoringFunction using different MutableMotifDiscovererToolbox.InitMethodForScoringFunction . |
static double[][] |
optimize(ScoringFunction[] funs,
OptimizableFunction opt,
byte algorithm,
double eps,
double linEps,
StartDistanceForecaster startDistance,
SafeOutputStream out,
boolean breakOnChanged,
History[][] hist,
int[][] minimalNewLength,
OptimizableFunction.KindOfParameter plugIn)
This method tries to optimize the problem at hand as good as possible. |
static double[][] |
optimize(ScoringFunction[] funs,
OptimizableFunction opt,
byte algorithm,
double eps,
double linEps,
StartDistanceForecaster startDistance,
SafeOutputStream out,
boolean breakOnChanged,
History template,
OptimizableFunction.KindOfParameter plugIn)
This method tries to optimize the problem at hand as good as possible. |
Methods inherited from class de.jstacs.motifDiscovery.MotifDiscovererToolBox |
---|
plot, plotAndAnnotate |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MutableMotifDiscovererToolbox()
Method Detail |
---|
public static Sequence enumerate(Sample[] data, ScoringFunction[] funs, int classIndex, int motifIndex, double weight, OptimizableFunction opt, OutputStream out) throws Exception
HiddenMotifsMixture
of a specific class.
data
- the datafuns
- the MutableMotifDiscovererToolbox.InitMethodForScoringFunction
sclassIndex
- the index of the classmotifIndex
- the index of the motif in the HiddenMotifsMixture
weight
- the weight of the seed Sequence
opt
- the objective functionout
- a stream that allows to write some output if necessary
Sequence
with respect to the OptimizableFunction
Exception
- if something went wrongpublic static ComparableElement<double[],Double>[] getSortedInitialParameters(Sample[] data, ScoringFunction[] funs, MutableMotifDiscovererToolbox.InitMethodForScoringFunction[] init, OptimizableFunction opt, int n, SafeOutputStream stream) throws Exception
MutableMotifDiscovererToolbox.InitMethodForScoringFunction
using different MutableMotifDiscovererToolbox.InitMethodForScoringFunction
. It returns an array of ComparableElement
s that contain the parameters and the
data
- the datafuns
- the MutableMotifDiscovererToolbox.InitMethodForScoringFunction
init
- the specific MutableMotifDiscovererToolbox.InitMethodForScoringFunction
, the entries correspond one to one to those of fun
opt
- the objective functionn
- the number of initializationsstream
- a stream that allows to write some output if necessary
ComparableElement
s of parameter arrays and corresponding values of the OptimizableFunction
Exception
- if something went wrongpublic static int[][] createMinimalNewLengthArray(ScoringFunction[] funs)
funs
- the ScoringFunctions used in an optimization
public static History[][] createHistoryArray(ScoringFunction[] funs, History template) throws CloneNotSupportedException
funs
- the ScoringFunctions used in an optimizationtemplate
- the template history instance
CloneNotSupportedException
- if the ttemplate
could not be clonedpublic static void clearHistoryArray(History[][] history)
history
- the arraypublic static double[][] optimize(ScoringFunction[] funs, OptimizableFunction opt, byte algorithm, double eps, double linEps, StartDistanceForecaster startDistance, SafeOutputStream out, boolean breakOnChanged, History template, OptimizableFunction.KindOfParameter plugIn) throws Exception
MutableMotifDiscoverer
s it tries to perform modify operations as long as they seem to be promising.
funs
- the MutableMotifDiscovererToolbox.InitMethodForScoringFunction
opt
- the OptimizableFunction
algorithm
- used for the optimizationeps
- used for the optimizationlinEps
- used for the optimizationstartDistance
- used for the optimizationout
- an stream that allows to obtain some information while optimizationbreakOnChanged
- a switch that decides whether a new optimization should be started after one successful modify or after all motifs have been tried to modify.template
- a history instance used to build an array with this instanceplugIn
- a switch whether to take the internal parameters or not
Exception
- if something went wrong while optimizationclearHistoryArray(de.jstacs.motifDiscovery.history.History[][])
,
optimize(de.jstacs.scoringFunctions.ScoringFunction[], de.jstacs.classifier.scoringFunctionBased.OptimizableFunction, byte, double, double, de.jstacs.algorithms.optimization.StartDistanceForecaster, de.jstacs.utils.SafeOutputStream, boolean, de.jstacs.motifDiscovery.history.History[][], int[][], de.jstacs.classifier.scoringFunctionBased.OptimizableFunction.KindOfParameter)
public static double[][] optimize(ScoringFunction[] funs, OptimizableFunction opt, byte algorithm, double eps, double linEps, StartDistanceForecaster startDistance, SafeOutputStream out, boolean breakOnChanged, History[][] hist, int[][] minimalNewLength, OptimizableFunction.KindOfParameter plugIn) throws Exception
MutableMotifDiscoverer
s it tries to perform modify operations as long as they seem to be promising.
funs
- the MutableMotifDiscovererToolbox.InitMethodForScoringFunction
opt
- the OptimizableFunction
algorithm
- used for the optimizationeps
- used for the optimizationlinEps
- used for the optimizationstartDistance
- used for the optimizationout
- an stream that allows to obtain some information while optimizationbreakOnChanged
- a switch that decides whether a new optimization should be started after one successful modify or after all motifs have been tried to modify.hist
- an array that is used to check whether a modify-operation can be performedminimalNewLength
- the minimal new length for each motif in each class, that will be used in an expand if the motif was shortened beforeplugIn
- a switch whether to take the internal parameters or not
Exception
- if something went wrong while optimizationpublic static boolean doHeuristicSteps(ScoringFunction[] funs, Sample[] data, double[][] weights, OptimizableFunction opt, SafeOutputStream out, boolean breakOnChanged, History[][] hist, int[][] minimalNewLength) throws Exception
MutableMotifDiscovererToolbox.InitMethodForScoringFunction
is a MutableMotifDiscoverer
.
These heuristic steps include shift, shrink, and expand as far as the user allows those operations by the History
array.
funs
- the MutableMotifDiscovererToolbox.InitMethodForScoringFunction
data
- array of Sample
containing the data for each classweights
- the weights corresponding to the Sequence
s in data
opt
- the OptimizableFunction
out
- an stream that allows to obtain some information while optimizationbreakOnChanged
- a switch that decides whether a new optimization should be started after one successful modify or after all motifs have been tried to modify.hist
- an array that is used to check whether a modify-operation can be performedminimalNewLength
- the minimal new length for each motif in each class, that will be used in an expand if the motif was shortened before
true
if some heuristic steps has been performed otherwise false
Exception
- if something went wrong
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |