public class LBR extends Classifier implements TechnicalInformationHandler
@article{Zheng2000, author = {Zijian Zheng and G. Webb}, journal = {Machine Learning}, number = {1}, pages = {53-84}, title = {Lazy Learning of Bayesian Rules}, volume = {4}, year = {2000} }Valid options are:
-D If set, classifier is run in debug mode and may output additional info to the console
Modifier and Type | Class and Description |
---|---|
class |
LBR.Indexes
Class for handling instances and the associated attributes.
|
Constructor and Description |
---|
LBR() |
Modifier and Type | Method and Description |
---|---|
double |
binomP(double r,
double n,
double p)
Significance test
binomp:
|
void |
buildClassifier(Instances instances)
For lazy learning, building classifier is only to prepare their inputs
until classification time.
|
double[] |
distributionForInstance(Instance testInstance)
Calculates the class membership probabilities
for the given test instance.
|
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() |
int |
leaveOneOut(LBR.Indexes instanceIndex,
int[][][] counts,
int[] priors,
boolean[] errorFlags)
Leave-one-out strategy.
|
double[] |
localDistributionForInstance(Instance instance,
LBR.Indexes instanceIndex)
Calculates the class membership probabilities.
|
void |
localNaiveBayes(LBR.Indexes instanceIndex)
Class for building and using a simple Naive Bayes classifier.
|
static void |
main(java.lang.String[] argv)
Main method for testing this class.
|
java.lang.String |
toString()
Returns a description of the classifier.
|
classifyInstance, 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
- set of instances serving as training datajava.lang.Exception
- if the preparation has not been generated.public double[] distributionForInstance(Instance testInstance) throws java.lang.Exception
distributionForInstance
in class Classifier
testInstance
- the instance to be classifiedjava.lang.Exception
- if distribution can't be computedpublic java.lang.String toString()
toString
in class java.lang.Object
public int leaveOneOut(LBR.Indexes instanceIndex, int[][][] counts, int[] priors, boolean[] errorFlags) throws java.lang.Exception
instanceIndex
- set of instances serving as training data.counts
- serving as all the counts of training data.priors
- serving as the number of instances in each class.errorFlags
- for the errorsjava.lang.Exception
- if something goes wrongpublic void localNaiveBayes(LBR.Indexes instanceIndex) throws java.lang.Exception
Richard Duda and Peter Hart (1973).Pattern Classification and Scene Analysis. Wiley, New York. This method only get m_Counts and m_Priors.
instanceIndex
- set of instances serving as training datajava.lang.Exception
- if m_Counts and m_Priors have not been
generated successfullypublic double[] localDistributionForInstance(Instance instance, LBR.Indexes instanceIndex) throws java.lang.Exception
instance
- the instance to be classifiedinstanceIndex
- java.lang.Exception
- if distribution can't be computedpublic double binomP(double r, double n, double p) throws java.lang.Exception
r
- n
- p
- java.lang.Exception
- if computation failspublic java.lang.String getRevision()
getRevision
in interface RevisionHandler
getRevision
in class Classifier
public static void main(java.lang.String[] argv)
argv
- the options