weka.attributeSelection
Class IGgaussian

java.lang.Object
  extended by weka.attributeSelection.ASEvaluation
      extended by weka.attributeSelection.IGgaussian
All Implemented Interfaces:
java.io.Serializable, weka.attributeSelection.AttributeEvaluator, weka.core.CapabilitiesHandler, weka.core.OptionHandler, weka.core.RevisionHandler

public class IGgaussian
extends weka.attributeSelection.ASEvaluation
implements weka.attributeSelection.AttributeEvaluator, weka.core.OptionHandler

Computes IG between a numerical attribute X and a multinomial class C without performing any discretization. see: "Supervised classification with conditional Gaussian networks: Increasing the structure complexity from Naive Bayes. Aritz Perez, Pedro Larraņaga, Iņaki Inza." If X is numerical: InfoGain(X,C) = 1/2(log(variance(X)) - sum_c=1^r P(c)log(variance(X|c)) if X is nominal: InfoGain(X,C) = H(X) - H(X|C)";

Author:
pablo.bermejo@uclm.es
See Also:
Serialized Form

Field Summary
private  double[] m_InfoGains
          The info gain for each attribute
(package private) static long serialVersionUID
          for serialisation
 
Constructor Summary
IGgaussian()
           
 
Method Summary
 void buildEvaluator(weka.core.Instances data)
          Initialises an information gain attribute evaluator.
 double evaluateAttribute(int attribute)
          evaluates an individual attribute by measuring the amount of information gained about the class given the attribute.
 weka.core.Capabilities getCapabilities()
          Returns the capabilities of this evaluator.
 java.lang.String[] getOptions()
           
 java.lang.String getRevision()
          Returns the revision string.
 java.lang.String globalInfo()
          Returns a string describing this attribute evaluator
 java.util.Enumeration listOptions()
           
static void main(java.lang.String[] args)
          Main method for testing this class.
protected  void resetOptions()
          Reset options to their default values
 void setOptions(java.lang.String[] options)
           
 java.lang.String toString()
          Describe the attribute evaluator
 
Methods inherited from class weka.attributeSelection.ASEvaluation
forName, makeCopies, postProcess, runEvaluator
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

serialVersionUID

static final long serialVersionUID
for serialisation

See Also:
Constant Field Values

m_InfoGains

private double[] m_InfoGains
The info gain for each attribute

Constructor Detail

IGgaussian

public IGgaussian()
Method Detail

globalInfo

public java.lang.String globalInfo()
Returns a string describing this attribute evaluator

Returns:
a description of the evaluator suitable for displaying in the explorer/experimenter gui

listOptions

public java.util.Enumeration listOptions()
Specified by:
listOptions in interface weka.core.OptionHandler

setOptions

public void setOptions(java.lang.String[] options)
                throws java.lang.Exception
Specified by:
setOptions in interface weka.core.OptionHandler
Throws:
java.lang.Exception

getOptions

public java.lang.String[] getOptions()
Specified by:
getOptions in interface weka.core.OptionHandler

resetOptions

protected void resetOptions()
Reset options to their default values


getCapabilities

public weka.core.Capabilities getCapabilities()
Returns the capabilities of this evaluator.

Specified by:
getCapabilities in interface weka.core.CapabilitiesHandler
Overrides:
getCapabilities in class weka.attributeSelection.ASEvaluation
Returns:
the capabilities of this evaluator
See Also:
Capabilities

buildEvaluator

public void buildEvaluator(weka.core.Instances data)
                    throws java.lang.Exception
Initialises an information gain attribute evaluator. No discretization is performed. For numerical atts: InfoGain(X,C) = 1/2(log(variance(X)) - sum_c=1^r P(c)log(variance(X|c)) For nominal atts: InfoGain(X,C) = H(X) - H(X|C)

Specified by:
buildEvaluator in class weka.attributeSelection.ASEvaluation
Parameters:
data - set of instances serving as training data
Throws:
java.lang.Exception - if the evaluator has not been generated successfully

evaluateAttribute

public double evaluateAttribute(int attribute)
                         throws java.lang.Exception
evaluates an individual attribute by measuring the amount of information gained about the class given the attribute.

Specified by:
evaluateAttribute in interface weka.attributeSelection.AttributeEvaluator
Parameters:
attribute - the index of the attribute to be evaluated
Returns:
the info gain
Throws:
java.lang.Exception - if the attribute could not be evaluated

toString

public java.lang.String toString()
Describe the attribute evaluator

Overrides:
toString in class java.lang.Object
Returns:
a description of the attribute evaluator as a string

getRevision

public java.lang.String getRevision()
Returns the revision string.

Specified by:
getRevision in interface weka.core.RevisionHandler
Overrides:
getRevision in class weka.attributeSelection.ASEvaluation
Returns:
the revision

main

public static void main(java.lang.String[] args)
Main method for testing this class.

Parameters:
args - the options [-i,fileRoute]