weka.classifiers.rules
Class ConjunctiveRule.Antd

java.lang.Object
  extended byweka.classifiers.rules.ConjunctiveRule.Antd
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
ConjunctiveRule.NominalAntd, ConjunctiveRule.NumericAntd
Enclosing class:
ConjunctiveRule

private abstract class ConjunctiveRule.Antd
extends java.lang.Object
implements java.io.Serializable

The single antecedent in the rule, which is composed of an attribute and the corresponding value. There are two inherited classes, namely NumericAntd and NominalAntd in which the attributes are numeric and nominal respectively.


Field Summary
protected  Attribute att
          The attribute of the antecedent
protected  double inform
          The information of this antecedent test on the growing data
protected  double maxInfoGain
          The maximum infoGain achieved by this antecedent test
protected  double[] uncover
          The parameters related to the data not covered by the previous antecedents when the class is nominal
protected  double uncoverSum
          The parameter related to the meanSquaredError of the data not covered by the previous antecedents when the class is numeric
protected  double uncoverWtSq
          The parameter related to the meanSquaredError of the data not covered by the previous antecedents when the class is numeric
protected  double uncoverWtVl
          The parameter related to the meanSquaredError of the data not covered by the previous antecedents when the class is numeric
protected  double value
          The attribute value of the antecedent.
 
Constructor Summary
ConjunctiveRule.Antd(Attribute a, double[] unc)
          Constructor for nominal class
ConjunctiveRule.Antd(Attribute a, double uncoveredWtSq, double uncoveredWtVl, double uncoveredWts)
           
 
Method Summary
protected  double entropy(double[] value, double sum)
          Function used to calculate the entropy of given vector of values entropy = (1/sum)*{-sigma[i=1..P](Xi*log2(Xi)) + sum*log2(sum)} where P is the length of the vector
 Attribute getAttr()
           
 double getAttrValue()
           
 double getInfo()
           
 double getMaxInfoGain()
           
abstract  boolean isCover(Instance inst)
           
abstract  Instances[] splitData(Instances data, double defInfo)
           
abstract  java.lang.String toString()
           
protected  double wtMeanSqErr(double weightedSq, double weightedValue, double sum)
          Function used to calculate the weighted mean squared error, i.e., sum[x-avg(x)]^2 based on the given elements of the formula: meanSquaredError = sum(Wi*Xi^2) - (sum(WiXi))^2/sum(Wi)
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

att

protected Attribute att
The attribute of the antecedent


value

protected double value
The attribute value of the antecedent. For numeric attribute, value is either 0(1st bag) or 1(2nd bag)


maxInfoGain

protected double maxInfoGain
The maximum infoGain achieved by this antecedent test


inform

protected double inform
The information of this antecedent test on the growing data


uncoverWtSq

protected double uncoverWtSq
The parameter related to the meanSquaredError of the data not covered by the previous antecedents when the class is numeric


uncoverWtVl

protected double uncoverWtVl
The parameter related to the meanSquaredError of the data not covered by the previous antecedents when the class is numeric


uncoverSum

protected double uncoverSum
The parameter related to the meanSquaredError of the data not covered by the previous antecedents when the class is numeric


uncover

protected double[] uncover
The parameters related to the data not covered by the previous antecedents when the class is nominal

Constructor Detail

ConjunctiveRule.Antd

public ConjunctiveRule.Antd(Attribute a,
                            double[] unc)
Constructor for nominal class


ConjunctiveRule.Antd

public ConjunctiveRule.Antd(Attribute a,
                            double uncoveredWtSq,
                            double uncoveredWtVl,
                            double uncoveredWts)
Method Detail

splitData

public abstract Instances[] splitData(Instances data,
                                      double defInfo)

isCover

public abstract boolean isCover(Instance inst)

toString

public abstract java.lang.String toString()

getAttr

public Attribute getAttr()

getAttrValue

public double getAttrValue()

getMaxInfoGain

public double getMaxInfoGain()

getInfo

public double getInfo()

wtMeanSqErr

protected double wtMeanSqErr(double weightedSq,
                             double weightedValue,
                             double sum)
Function used to calculate the weighted mean squared error, i.e., sum[x-avg(x)]^2 based on the given elements of the formula: meanSquaredError = sum(Wi*Xi^2) - (sum(WiXi))^2/sum(Wi)

Parameters:
weightedSq - sum(Wi*Xi^2)
weightedValue - sum(WiXi)
sum - sum of weights
Returns:
the weighted mean-squared error

entropy

protected double entropy(double[] value,
                         double sum)
Function used to calculate the entropy of given vector of values entropy = (1/sum)*{-sigma[i=1..P](Xi*log2(Xi)) + sum*log2(sum)} where P is the length of the vector

Parameters:
value - the given vector of values
sum - the sum of the given values. It's provided just for efficiency.
Returns:
the entropy