racs
Class Id3Metric
- public class Id3Metric
- extends weka.classifiers.Classifier
m_Successors
private racs.Id3Metric[] m_Successors
- The node's successors.
m_Attribute
private weka.core.Attribute m_Attribute
- Attribute used for splitting.
m_att_prototypes
private int[] m_att_prototypes
- attribute prototypes used by the split
weight_prototypes
private int[] weight_prototypes
- weights of each prototype = number of instances captured by the prototype
ratio_prototypes
private double[] ratio_prototypes
- hello
m_ClassValue
private double m_ClassValue
- Class value if node is leaf.
m_Distribution
private double[] m_Distribution
- Class distribution if node is leaf.
m_ClassAttribute
private weka.core.Attribute m_ClassAttribute
- Class attribute of dataset.
makeTree
private void makeTree(weka.core.Instances data,
racs.MetricSpace ms)
- Method building Id3 tree.
- Parameters:
data
- the training data
- Throws:
Exception
- if decision tree can't be built successfully
classifyInstance
public double classifyInstance(weka.core.Instance inst,
racs.MetricSpace ms)
- Classifies a given test instance using the decision tree.
- Parameters:
instance
- the instance to be classified
- Returns:
- the classification
distributionForInstance
public double[] distributionForInstance(weka.core.Instance instance)
- Computes class distribution for instance using decision tree.
- Parameters:
instance
- the instance for which distribution is to be computed
- Returns:
- the class distribution for the given instance
toString
public java.lang.String toString()
- Prints the decision tree using the private toString method from below.
- Returns:
- a textual description of the classifier
computeInfoGain
private double computeInfoGain(weka.core.Instances data,
weka.core.Attribute att)
- Computes information gain for an attribute.
- Parameters:
data
- the data for which info gain is to be computed
att
- the attribute
- Returns:
- the information gain for the given attribute and data
computeEntropy
private double computeEntropy(weka.core.Instances data)
- Computes the entropy of a dataset.
- Parameters:
data
- the data for which entropy is to be computed
- Returns:
- the entropy of the data's class distribution
splitData
private weka.core.Instances[] splitData(weka.core.Instances data,
weka.core.Attribute att)
- Splits a dataset according to the values of a nominal attribute.
- Parameters:
data
- the data which is to be split
att
- the attribute to be used for splitting
- Returns:
- the sets of instances produced by the split
toString
private java.lang.String toString(int level)
- Outputs a tree at a certain level.
- Parameters:
level
- the level at which the tree is to be printed