|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectweka.classifiers.Classifier
weka.classifiers.trees.NBTree
public class NBTree
Class for generating a decision tree with naive Bayes classifiers at the leaves.
For more information, see
Ron Kohavi: Scaling Up the Accuracy of Naive-Bayes Classifiers: A Decision-Tree Hybrid. In: Second International Conference on Knoledge Discovery and Data Mining, 202-207, 1996.
@inproceedings{Kohavi1996, author = {Ron Kohavi}, booktitle = {Second International Conference on Knoledge Discovery and Data Mining}, pages = {202-207}, title = {Scaling Up the Accuracy of Naive-Bayes Classifiers: A Decision-Tree Hybrid}, year = {1996} }Valid options are:
-D If set, classifier is run in debug mode and may output additional info to the console
Field Summary |
---|
Fields inherited from interface weka.core.Drawable |
---|
BayesNet, Newick, NOT_DRAWABLE, TREE |
Constructor Summary | |
---|---|
NBTree()
|
Method Summary | |
---|---|
void |
buildClassifier(Instances instances)
Generates the classifier. |
double |
classifyInstance(Instance instance)
Classifies an instance. |
double[] |
distributionForInstance(Instance instance)
Returns class probabilities for an instance. |
java.util.Enumeration |
enumerateMeasures()
Returns an enumeration of the additional measure names |
Capabilities |
getCapabilities()
Returns default capabilities of the classifier. |
double |
getMeasure(java.lang.String additionalMeasureName)
Returns the value of the named measure |
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 classifier |
java.lang.String |
graph()
Returns graph describing the tree. |
int |
graphType()
Returns the type of graph this classifier represents. |
static void |
main(java.lang.String[] argv)
Main method for testing this class |
double |
measureNumLeaves()
Returns the number of leaves |
double |
measureNumRules()
Returns the number of rules (same as number of leaves) |
double |
measureTreeSize()
Returns the size of the tree |
java.lang.String |
toString()
Returns a description of the classifier. |
java.lang.String |
toSummaryString()
Returns a superconcise version of the model |
Methods inherited from class weka.classifiers.Classifier |
---|
debugTipText, forName, getDebug, getOptions, listOptions, makeCopies, makeCopy, setDebug, setOptions |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public NBTree()
Method Detail |
---|
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 instances) throws java.lang.Exception
buildClassifier
in class Classifier
instances
- the data to train with
java.lang.Exception
- if classifier can't be built successfullypublic double classifyInstance(Instance instance) throws java.lang.Exception
classifyInstance
in class Classifier
instance
- the instance to classify
java.lang.Exception
- if instance can't be classified successfullypublic final double[] distributionForInstance(Instance instance) throws java.lang.Exception
distributionForInstance
in class Classifier
instance
- the instance to get the distribution for
java.lang.Exception
- if distribution can't be computed successfullypublic java.lang.String toString()
toString
in class java.lang.Object
public int graphType()
graphType
in interface Drawable
public java.lang.String graph() throws java.lang.Exception
graph
in interface Drawable
java.lang.Exception
- if graph can't be computedpublic java.lang.String toSummaryString()
toSummaryString
in interface Summarizable
public double measureTreeSize()
public double measureNumLeaves()
public double measureNumRules()
public double getMeasure(java.lang.String additionalMeasureName)
getMeasure
in interface AdditionalMeasureProducer
additionalMeasureName
- the name of the measure to query for its value
java.lang.IllegalArgumentException
- if the named measure is not supportedpublic java.util.Enumeration enumerateMeasures()
enumerateMeasures
in interface AdditionalMeasureProducer
public java.lang.String getRevision()
getRevision
in interface RevisionHandler
getRevision
in class Classifier
public static void main(java.lang.String[] argv)
argv
- the commandline options
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |