de.jstacs.sequenceScores.statisticalModels.differentiable.directedGraphicalModels.structureLearning.measures.btMeasures
Class BTMutualInformation

java.lang.Object
  extended by de.jstacs.sequenceScores.statisticalModels.differentiable.directedGraphicalModels.structureLearning.measures.Measure
      extended by de.jstacs.sequenceScores.statisticalModels.differentiable.directedGraphicalModels.structureLearning.measures.btMeasures.BTMutualInformation
All Implemented Interfaces:
InstantiableFromParameterSet, Storable, Cloneable

public class BTMutualInformation
extends Measure

Structure learning Measure that computes a maximum spanning tree based on mutual information and uses the resulting tree structure as structure of a Bayesian tree (special case of a Bayesian network) in a BayesianNetworkDiffSM .

Author:
Jan Grau

Nested Class Summary
static class BTMutualInformation.BTMutualInformationParameterSet
          Class for the parameters of a BTMutualInformation structure Measure.
static class BTMutualInformation.DataSource
          Enum defining the possible sources of data to compute the mutual information.
 
Nested classes/interfaces inherited from class de.jstacs.sequenceScores.statisticalModels.differentiable.directedGraphicalModels.structureLearning.measures.Measure
Measure.MeasureParameterSet
 
Field Summary
 
Fields inherited from class de.jstacs.sequenceScores.statisticalModels.differentiable.directedGraphicalModels.structureLearning.measures.Measure
parameters
 
Constructor Summary
BTMutualInformation(BTMutualInformation.BTMutualInformationParameterSet parameters)
          Creates a new BTMutualInformation from the corresponding InstanceParameterSet parameters.
BTMutualInformation(BTMutualInformation.DataSource clazz, double[] ess)
          Creates a new mutual information Bayesian tree Measure.
BTMutualInformation(StringBuffer buf)
          The standard constructor for the interface Storable.
 
Method Summary
 String getInstanceName()
          Returns the name of the Measure and possibly some additional information about the current instance.
 int[][] getParents(DataSet fg, DataSet bg, double[] weightsFg, double[] weightsBg, int length)
          Returns the optimal parents for the given data and weights.
 String getXMLTag()
          Returns the XML-tag for storing this measure
 
Methods inherited from class de.jstacs.sequenceScores.statisticalModels.differentiable.directedGraphicalModels.structureLearning.measures.Measure
clone, fillTensor, fillTensor, getCMI, getCMI, getCurrentParameterSet, getEAR, getEAR, getMI, getMI, getStatistics, getStatisticsOrderTwo, isShiftable, sum, toParents, toXML, union
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BTMutualInformation

public BTMutualInformation(StringBuffer buf)
                    throws NonParsableException
The standard constructor for the interface Storable. Recreates a BTMutualInformation from is XML representation as returned by Measure.toXML().

Parameters:
buf - the XML representation as StringBuffer
Throws:
NonParsableException - if the XML code could not be parsed

BTMutualInformation

public BTMutualInformation(BTMutualInformation.DataSource clazz,
                           double[] ess)
                    throws CloneNotSupportedException,
                           Exception
Creates a new mutual information Bayesian tree Measure.

Parameters:
clazz - the classes used for computation of mutual information, as defined by BTMutualInformation.DataSource
ess - the equivalent sample sizes for both classes
Throws:
CloneNotSupportedException - if the parameters could not be created
Exception - if the parameters could not be created for the ess

BTMutualInformation

public BTMutualInformation(BTMutualInformation.BTMutualInformationParameterSet parameters)
                    throws CloneNotSupportedException
Creates a new BTMutualInformation from the corresponding InstanceParameterSet parameters.

Parameters:
parameters - the corresponding parameters
Throws:
CloneNotSupportedException - if the parameters could not be cloned
Method Detail

getInstanceName

public String getInstanceName()
Description copied from class: Measure
Returns the name of the Measure and possibly some additional information about the current instance.

Specified by:
getInstanceName in class Measure
Returns:
the name of the Measure

getParents

public int[][] getParents(DataSet fg,
                          DataSet bg,
                          double[] weightsFg,
                          double[] weightsBg,
                          int length)
                   throws Exception
Description copied from class: Measure
Returns the optimal parents for the given data and weights. The returned array of parents p at each position i is build as follows:

Specified by:
getParents in class Measure
Parameters:
fg - the data of the current (foreground) class
bg - the data of the negative (background) class
weightsFg - the weights for the sequences of fg
weightsBg - the weights for the sequences of bg
length - the length of the model, must be equal to the length of the sequences
Returns:
the the array p with the optimal parents
Throws:
Exception - if the lengths do not match or other problems concerning the data occur

getXMLTag

public String getXMLTag()
Description copied from class: Measure
Returns the XML-tag for storing this measure

Specified by:
getXMLTag in class Measure
Returns:
the tag