|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectde.jstacs.sequenceScores.statisticalModels.differentiable.directedGraphicalModels.structureLearning.measures.Measure
public abstract class Measure
Class for structure measures that derive an optimal structure with respect to some criterion within a class of possible structures from data.
| Nested Class Summary | |
|---|---|
static class |
Measure.MeasureParameterSet
This class is the super class of any ParameterSet that can be used to instantiate a Measure. |
| Field Summary | |
|---|---|
protected Measure.MeasureParameterSet |
parameters
The parameters of this measure |
| Constructor Summary | |
|---|---|
protected |
Measure(Measure.MeasureParameterSet parameters)
Creates a new Measure from its Measure.MeasureParameterSet. |
protected |
Measure(StringBuffer xml)
Creates a new Measure from its XML-representation. |
| Method Summary | |
|---|---|
Measure |
clone()
|
protected static void |
fillTensor(Tensor t,
double[][] weights)
Fills a Tensor t with the weights defined in
weights. |
protected static void |
fillTensor(Tensor t,
double[][][] weights)
Fills a Tensor t with the weights defined in
weights. |
protected static double[][][] |
getCMI(double[][][][][][] fgStats,
double[][][][][][] bgStats,
double n)
Computes the conditional mutual information from fgStats and
bgStats counted on sequences with a total weight of
n. |
protected static double[][] |
getCMI(double[][][][] fgStats,
double[][][][] bgStats,
double n,
double nFg,
double nBg)
Computes the conditional mutual information from fgStats and
bgStats counted on sequences with a total weight of
nFg and nBg, respectively. |
InstanceParameterSet<Measure> |
getCurrentParameterSet()
Returns the InstanceParameterSet that has been used to
instantiate the current instance of the implementing class. |
static double[][][] |
getEAR(double[][][][][][] fgStats,
double[][][][][][] bgStats,
double nFg,
double nBg)
Computes the explaining away residual from fgStats and
bgStats counted on sequences with a total weight of
nFg and nBg, respectively. |
protected static double[][] |
getEAR(double[][][][] fgStats,
double[][][][] bgStats,
double nFg,
double nBg)
Computes the explaining away residual from fgStats and
bgStats counted on sequences with a total weight of
nFg and nBg, respectively. |
abstract String |
getInstanceName()
Returns the name of the Measure and possibly some additional
information about the current instance. |
protected static double[][][] |
getMI(double[][][][][][] counts,
double n)
Computes the mutual information from counts counted on
sequences with a total weight of n. |
protected static double[][] |
getMI(double[][][][] counts,
double n)
Computes the mutual information from counts counted on
sequences with a total weight of n. |
abstract int[][] |
getParents(DataSet fg,
DataSet bg,
double[] weightsFg,
double[] weightsBg,
int length)
Returns the optimal parents for the given data and weights. |
protected static double[][][][] |
getStatistics(DataSet s,
double[] weights,
int length,
double ess)
Counts the occurrences of symbols of the AlphabetContainer of
DataSet s using weights. |
protected static double[][][][][][] |
getStatisticsOrderTwo(DataSet s,
double[] weights,
int length,
double ess)
Counts the occurrences of symbols of the AlphabetContainer of
DataSet s using weights. |
abstract String |
getXMLTag()
Returns the XML-tag for storing this measure |
boolean |
isShiftable()
Indicates if Measure supports shifts. |
protected static double |
sum(double[] ar)
Computes the sum of all elements in the array ar. |
protected static int[][] |
toParents(int[] o,
byte order)
Creates a new parent structure as defined by getParents(DataSet, DataSet, double[], double[], int) from an
order and a topological ordering of positions. |
StringBuffer |
toXML()
This method returns an XML representation as StringBuffer of an
instance of the implementing class. |
protected static double[] |
union(double[][] ar)
Linearizes the arrays in the two-dimensional array ar to
form a new, one-dimensional array. |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected Measure.MeasureParameterSet parameters
| Constructor Detail |
|---|
protected Measure(StringBuffer xml)
throws NonParsableException
Measure from its XML-representation.
xml - the XML-representation
NonParsableException - the the XML could not be parsed
protected Measure(Measure.MeasureParameterSet parameters)
throws CloneNotSupportedException
Measure from its Measure.MeasureParameterSet.
parameters - the parameters
CloneNotSupportedException - if the parameters could not be cloned| Method Detail |
|---|
public abstract String getXMLTag()
public StringBuffer toXML()
StorableStringBuffer of an
instance of the implementing class.
toXML in interface Storable
public final InstanceParameterSet<Measure> getCurrentParameterSet()
throws Exception
InstantiableFromParameterSetInstanceParameterSet that has been used to
instantiate the current instance of the implementing class. If the
current instance was not created using an InstanceParameterSet,
an equivalent InstanceParameterSet should be returned, so that an
instance created using this InstanceParameterSet would be in
principle equal to the current instance.
getCurrentParameterSet in interface InstantiableFromParameterSetInstanceParameterSet
Exception - if the InstanceParameterSet could not be returnedpublic abstract String getInstanceName()
Measure and possibly some additional
information about the current instance.
Measure
public abstract int[][] getParents(DataSet fg,
DataSet bg,
double[] weightsFg,
double[] weightsBg,
int length)
throws Exception
p at each position i is build
as follows:
p[i][p.length - 1] contains the index i
itselfp[i][p.length - 2] contains the "most
important" parentp[i][0] contains the "least important" parent
fg - the data of the current (foreground) classbg - the data of the negative (background) classweightsFg - the weights for the sequences of fgweightsBg - the weights for the sequences of bglength - the length of the model, must be equal to the length of the
sequences
p with the optimal parents
Exception - if the lengths do not match or other problems concerning the
data occur
public Measure clone()
throws CloneNotSupportedException
clone in class ObjectCloneNotSupportedException
protected static int[][] toParents(int[] o,
byte order)
getParents(DataSet, DataSet, double[], double[], int) from an
order and a topological ordering of positions.
o - the topological orderingorder - the order
protected static void fillTensor(Tensor t,
double[][] weights)
Tensor t with the weights defined in
weights.
t - the Tensor to be filledweights - the weights
protected static void fillTensor(Tensor t,
double[][][] weights)
Tensor t with the weights defined in
weights.
t - the Tensor to be filledweights - the weights
protected static double[][][] getMI(double[][][][][][] counts,
double n)
counts counted on
sequences with a total weight of n.
counts - the counts as returned by
getStatisticsOrderTwo(DataSet, double[], int, double)n - the total weight
protected static double[][][] getCMI(double[][][][][][] fgStats,
double[][][][][][] bgStats,
double n)
fgStats and
bgStats counted on sequences with a total weight of
n.
fgStats - the counts in the foreground sequences as returned by
getStatisticsOrderTwo(DataSet, double[], int, double)bgStats - the counts in the foreground sequences as returned by
getStatisticsOrderTwo(DataSet, double[], int, double)n - the total weight
public static double[][][] getEAR(double[][][][][][] fgStats,
double[][][][][][] bgStats,
double nFg,
double nBg)
fgStats and
bgStats counted on sequences with a total weight of
nFg and nBg, respectively.
fgStats - the counts in the foreground sequences as returned by
getStatisticsOrderTwo(DataSet, double[], int, double)bgStats - the counts in the foreground sequences as returned by
getStatisticsOrderTwo(DataSet, double[], int, double)nFg - the total weight in the foregroundnBg - the total weight in the background
protected static double[][][][][][] getStatisticsOrderTwo(DataSet s,
double[] weights,
int length,
double ess)
throws Exception
AlphabetContainer of
DataSet s using weights. The array
counts is indexed as follows:counts[first index][second index][third index][symbol at first index][symbol at second index][symbol at third index]
.
s - the dataweights - the weightslength - the length of the sequencesess - the equivalent sample size
counts with the symbol occurrences
Exception - if the lengths do not match or other problems concerning the
data occur
protected static double[][][][] getStatistics(DataSet s,
double[] weights,
int length,
double ess)
throws Exception
AlphabetContainer of
DataSet s using weights. The array
counts is indexed as follows:counts[first index][second index][symbol at first index][symbol at second index]
.
s - the dataweights - the weightslength - the length of the sequencesess - the equivalent sample size
counts with the symbol occurrences
Exception - if the lengths do not match or other problems concerning the
data occur
protected static double[][] getMI(double[][][][] counts,
double n)
counts counted on
sequences with a total weight of n.
counts - the counts as defined in
getStatistics(DataSet, double[], int, double).n - the total weight
protected static double[][] getCMI(double[][][][] fgStats,
double[][][][] bgStats,
double n,
double nFg,
double nBg)
fgStats and
bgStats counted on sequences with a total weight of
nFg and nBg, respectively.
fgStats - the counts as defined in
getStatistics(DataSet, double[], int, double) on the
foregroundbgStats - the counts as defined in
getStatistics(DataSet, double[], int, double) on the
backgroundn - the total weightnFg - the total weight in the foregroundnBg - the total weight in the background
protected static double[][] getEAR(double[][][][] fgStats,
double[][][][] bgStats,
double nFg,
double nBg)
fgStats and
bgStats counted on sequences with a total weight of
nFg and nBg, respectively.
fgStats - the counts as defined in
getStatistics(DataSet, double[], int, double) on the
foregroundbgStats - the counts as defined in
getStatistics(DataSet, double[], int, double) on the
backgroundnFg - the total weight in the foregroundnBg - the total weight in the background
protected static double sum(double[] ar)
ar.
ar - the array
protected static double[] union(double[][] ar)
ar to
form a new, one-dimensional array.
ar - the two-dimensional array
public boolean isShiftable()
Measure supports shifts.
Measure supports shifts
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||