public class NBTree extends Classifier implements WeightedInstancesHandler, Drawable, Summarizable, AdditionalMeasureProducer, TechnicalInformationHandler
@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
BayesNet, Newick, NOT_DRAWABLE, TREE
Constructor and Description |
---|
NBTree() |
Modifier and Type | Method and Description |
---|---|
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
|
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 instances) throws java.lang.Exception
buildClassifier
in class Classifier
instances
- the data to train withjava.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 classifyjava.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 forjava.lang.Exception
- if distribution can't be computed successfullypublic java.lang.String toString()
toString
in class java.lang.Object
public int graphType()
public java.lang.String graph() throws java.lang.Exception
public 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 valuejava.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