weka.classifiers.trees
Class Id3

java.lang.Object
  extended byweka.classifiers.Classifier
      extended byweka.classifiers.trees.Id3
All Implemented Interfaces:
java.lang.Cloneable, OptionHandler, java.io.Serializable

public class Id3
extends Classifier

Class implementing an Id3 decision tree classifier. For more information, see

R. Quinlan (1986). Induction of decision trees. Machine Learning. Vol.1, No.1, pp. 81-106.

Version:
$Revision: 1.13 $
Author:
Eibe Frank (eibe@cs.waikato.ac.nz)
See Also:
Serialized Form

Constructor Summary
Id3()
           
 
Method Summary
 void buildClassifier(Instances data)
          Builds Id3 decision tree classifier.
 double classifyInstance(Instance instance)
          Classifies a given test instance using the decision tree.
 double[] distributionForInstance(Instance instance)
          Computes class distribution for instance using decision tree.
 java.lang.String globalInfo()
          Returns a string describing the classifier.
static void main(java.lang.String[] args)
          Main method.
 java.lang.String toString()
          Prints the decision tree using the private toString method from below.
 
Methods inherited from class weka.classifiers.Classifier
debugTipText, forName, getDebug, getOptions, listOptions, makeCopies, setDebug, setOptions
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Id3

public Id3()
Method Detail

globalInfo

public java.lang.String globalInfo()
Returns a string describing the classifier.

Returns:
a description suitable for the GUI.

buildClassifier

public void buildClassifier(Instances data)
                     throws java.lang.Exception
Builds Id3 decision tree classifier.

Specified by:
buildClassifier in class Classifier
Parameters:
data - the training data
Throws:
java.lang.Exception - if classifier can't be built successfully

classifyInstance

public double classifyInstance(Instance instance)
                        throws NoSupportForMissingValuesException
Classifies a given test instance using the decision tree.

Overrides:
classifyInstance in class Classifier
Parameters:
instance - the instance to be classified
Returns:
the classification
Throws:
NoSupportForMissingValuesException

distributionForInstance

public double[] distributionForInstance(Instance instance)
                                 throws NoSupportForMissingValuesException
Computes class distribution for instance using decision tree.

Overrides:
distributionForInstance in class Classifier
Parameters:
instance - the instance for which distribution is to be computed
Returns:
the class distribution for the given instance
Throws:
NoSupportForMissingValuesException

toString

public java.lang.String toString()
Prints the decision tree using the private toString method from below.

Returns:
a textual description of the classifier

main

public static void main(java.lang.String[] args)
Main method.

Parameters:
args - the options for the classifier