public class Id3 extends Classifier implements TechnicalInformationHandler, Sourcable
@article{Quinlan1986, author = {R. Quinlan}, journal = {Machine Learning}, number = {1}, pages = {81-106}, title = {Induction of decision trees}, volume = {1}, year = {1986} }Valid options are:
-D If set, classifier is run in debug mode and may output additional info to the console
Constructor and Description |
---|
Id3() |
Modifier and Type | Method and Description |
---|---|
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.
|
Capabilities |
getCapabilities()
Returns default capabilities of the classifier.
|
java.lang.String |
getRevision()
Returns the revision string.
|
TechnicalInformation |
getTechnicalInformation()
Returns an instance of a TechnicalInformation object, containing
detailed information about the technical background of this class,
e.g., paper reference or book this class is based on.
|
java.lang.String |
globalInfo()
Returns a string describing the classifier.
|
static void |
main(java.lang.String[] args)
Main method.
|
java.lang.String |
toSource(java.lang.String className)
Returns a string that describes the classifier as source.
|
java.lang.String |
toString()
Prints the decision tree using the private toString method from below.
|
debugTipText, forName, getDebug, getOptions, listOptions, makeCopies, makeCopy, setDebug, setOptions
public java.lang.String globalInfo()
public TechnicalInformation getTechnicalInformation()
getTechnicalInformation
in interface TechnicalInformationHandler
public Capabilities getCapabilities()
getCapabilities
in interface CapabilitiesHandler
getCapabilities
in class Classifier
Capabilities
public void buildClassifier(Instances data) throws java.lang.Exception
buildClassifier
in class Classifier
data
- the training datajava.lang.Exception
- if classifier can't be built successfullypublic double classifyInstance(Instance instance) throws NoSupportForMissingValuesException
classifyInstance
in class Classifier
instance
- the instance to be classifiedNoSupportForMissingValuesException
- if instance has missing valuespublic double[] distributionForInstance(Instance instance) throws NoSupportForMissingValuesException
distributionForInstance
in class Classifier
instance
- the instance for which distribution is to be computedNoSupportForMissingValuesException
- if instance has missing valuespublic java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String toSource(java.lang.String className) throws java.lang.Exception
public static double classify(Object[] i);
where the array i
contains elements that are either
Double, String, with missing values represented as null. The generated
code is public domain and comes with no warranty. public java.lang.String getRevision()
getRevision
in interface RevisionHandler
getRevision
in class Classifier
public static void main(java.lang.String[] args)
args
- the options for the classifier