public class Id3
extends weka.classifiers.AbstractClassifier
implements weka.core.TechnicalInformationHandler, weka.classifiers.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(weka.core.Instances data)
Builds Id3 decision tree classifier.
|
double |
classifyInstance(weka.core.Instance instance)
Classifies a given test instance using the decision tree.
|
double[] |
distributionForInstance(weka.core.Instance instance)
Computes class distribution for instance using decision tree.
|
weka.core.Capabilities |
getCapabilities()
Returns default capabilities of the classifier.
|
java.lang.String |
getRevision()
Returns the revision string.
|
weka.core.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.
|
batchSizeTipText, debugTipText, distributionsForInstances, doNotCheckCapabilitiesTipText, forName, getBatchSize, getDebug, getDoNotCheckCapabilities, getNumDecimalPlaces, getOptions, implementsMoreEfficientBatchPrediction, listOptions, makeCopies, makeCopy, numDecimalPlacesTipText, postExecution, preExecution, run, runClassifier, setBatchSize, setDebug, setDoNotCheckCapabilities, setNumDecimalPlaces, setOptions
public java.lang.String globalInfo()
public weka.core.TechnicalInformation getTechnicalInformation()
getTechnicalInformation
in interface weka.core.TechnicalInformationHandler
public weka.core.Capabilities getCapabilities()
getCapabilities
in interface weka.classifiers.Classifier
getCapabilities
in interface weka.core.CapabilitiesHandler
getCapabilities
in class weka.classifiers.AbstractClassifier
public void buildClassifier(weka.core.Instances data) throws java.lang.Exception
buildClassifier
in interface weka.classifiers.Classifier
data
- the training datajava.lang.Exception
- if classifier can't be built successfullypublic double classifyInstance(weka.core.Instance instance) throws weka.core.NoSupportForMissingValuesException
classifyInstance
in interface weka.classifiers.Classifier
classifyInstance
in class weka.classifiers.AbstractClassifier
instance
- the instance to be classifiedweka.core.NoSupportForMissingValuesException
- if instance has missing valuespublic double[] distributionForInstance(weka.core.Instance instance) throws weka.core.NoSupportForMissingValuesException
distributionForInstance
in interface weka.classifiers.Classifier
distributionForInstance
in class weka.classifiers.AbstractClassifier
instance
- the instance for which distribution is to be computedweka.core.NoSupportForMissingValuesException
- 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. toSource
in interface weka.classifiers.Sourcable
className
- the name that should be given to the source class.java.lang.Exception
- if the source can't be computedpublic java.lang.String getRevision()
getRevision
in interface weka.core.RevisionHandler
getRevision
in class weka.classifiers.AbstractClassifier
public static void main(java.lang.String[] args)
args
- the options for the classifier