|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectweka.classifiers.Classifier
net.sf.bddbddb.order.MyId3
public class MyId3
Class implementing an Id3 decision tree classifier. This version differs from the weka one in that it supports missing attributes.
| Field Summary |
|---|
| Fields inherited from class weka.classifiers.Classifier |
|---|
m_Debug |
| Constructor Summary | |
|---|---|
MyId3()
|
|
| Method Summary | |
|---|---|
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. |
boolean |
getAttribCombos(weka.core.Instances i,
double cv)
|
java.util.List |
getAttribCombos(int nAttribs,
double cv)
|
java.lang.String |
globalInfo()
Returns a string describing the classifier. |
void |
laplaceSmooth(double[] dist,
double sum,
int numClasses)
|
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 |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public MyId3()
| Method Detail |
|---|
public boolean getAttribCombos(weka.core.Instances i,
double cv)
public java.util.List getAttribCombos(int nAttribs,
double cv)
public java.lang.String globalInfo()
public void buildClassifier(weka.core.Instances data)
throws java.lang.Exception
buildClassifier in class weka.classifiers.Classifierdata - the training data
java.lang.Exception - if classifier can't be built successfully
public void laplaceSmooth(double[] dist,
double sum,
int numClasses)
public double classifyInstance(weka.core.Instance instance)
classifyInstance in class weka.classifiers.Classifierinstance - the instance to be classified
public double[] distributionForInstance(weka.core.Instance instance)
throws weka.core.NoSupportForMissingValuesException
distributionForInstance in class weka.classifiers.Classifierinstance - the instance for which distribution is to be computed
weka.core.NoSupportForMissingValuesExceptionpublic java.lang.String toString()
toString in class java.lang.Objectpublic static void main(java.lang.String[] args)
args - the options for the classifier
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||