类 LBR

所有已实现的接口:
Serializable, Cloneable, CapabilitiesHandler, OptionHandler, RevisionHandler, TechnicalInformationHandler

public class LBR extends Classifier implements TechnicalInformationHandler
Lazy Bayesian Rules Classifier. The naive Bayesian classifier provides a simple and effective approach to classifier learning, but its attribute independence assumption is often violated in the real world. Lazy Bayesian Rules selectively relaxes the independence assumption, achieving lower error rates over a range of learning tasks. LBR defers processing to classification time, making it a highly efficient and accurate classification algorithm when small numbers of objects are to be classified.

For more information, see:

Zijian Zheng, G. Webb (2000). Lazy Learning of Bayesian Rules. Machine Learning. 4(1):53-84.

BibTeX:

 @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
版本:
$Revision: 5525 $
作者:
Zhihai Wang (zhw@deakin.edu.au) : July 2001 implemented the algorithm, Jason Wells (wells@deakin.edu.au) : November 2001 added instance referencing via indexes
另请参阅:
  • 构造器详细资料

    • LBR

      public LBR()
  • 方法详细资料

    • globalInfo

      public String globalInfo()
      返回:
      a description of the classifier suitable for displaying in the explorer/experimenter gui
    • getTechnicalInformation

      public 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.
      指定者:
      getTechnicalInformation 在接口中 TechnicalInformationHandler
      返回:
      the technical information about this class
    • getCapabilities

      public Capabilities getCapabilities()
      Returns default capabilities of the classifier.
      指定者:
      getCapabilities 在接口中 CapabilitiesHandler
      覆盖:
      getCapabilities 在类中 Classifier
      返回:
      the capabilities of this classifier
      另请参阅:
    • buildClassifier

      public void buildClassifier(Instances instances) throws Exception
      For lazy learning, building classifier is only to prepare their inputs until classification time.
      指定者:
      buildClassifier 在类中 Classifier
      参数:
      instances - set of instances serving as training data
      抛出:
      Exception - if the preparation has not been generated.
    • distributionForInstance

      public double[] distributionForInstance(Instance testInstance) throws Exception
      Calculates the class membership probabilities for the given test instance. This is the most important method for Lazy Bayesian Rule algorithm.
      覆盖:
      distributionForInstance 在类中 Classifier
      参数:
      testInstance - the instance to be classified
      返回:
      predicted class probability distribution
      抛出:
      Exception - if distribution can't be computed
    • toString

      public String toString()
      Returns a description of the classifier.
      覆盖:
      toString 在类中 Object
      返回:
      a description of the classifier as a string.
    • leaveOneOut

      public int leaveOneOut(LBR.Indexes instanceIndex, int[][][] counts, int[] priors, boolean[] errorFlags) throws Exception
      Leave-one-out strategy. For a given sample data set with n instances, using (n - 1) instances by leaving one out and tested on the single remaining case. This is repeated n times in turn. The final "Error" is the sum of the instances to be classified incorrectly.
      参数:
      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 errors
      返回:
      error flag array about each instance.
      抛出:
      Exception - if something goes wrong
    • localNaiveBayes

      public void localNaiveBayes(LBR.Indexes instanceIndex) throws Exception
      Class for building and using a simple Naive Bayes classifier. For more information, see

      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 data
      抛出:
      Exception - if m_Counts and m_Priors have not been generated successfully
    • localDistributionForInstance

      public double[] localDistributionForInstance(Instance instance, LBR.Indexes instanceIndex) throws Exception
      Calculates the class membership probabilities. for the given test instance.
      参数:
      instance - the instance to be classified
      instanceIndex -
      返回:
      predicted class probability distribution
      抛出:
      Exception - if distribution can't be computed
    • binomP

      public double binomP(double r, double n, double p) throws Exception
      Significance test binomp:
      参数:
      r -
      n -
      p -
      返回:
      returns the probability of obtaining r or fewer out of n if the probability of an event is p.
      抛出:
      Exception - if computation fails
    • getRevision

      public String getRevision()
      Returns the revision string.
      指定者:
      getRevision 在接口中 RevisionHandler
      覆盖:
      getRevision 在类中 Classifier
      返回:
      the revision
    • main

      public static void main(String[] argv)
      Main method for testing this class.
      参数:
      argv - the options