Codota Logo
NaiveBayesUpdateable
Code IndexAdd Codota to your IDE (free)

How to use
NaiveBayesUpdateable
in
weka.classifiers.bayes

Best Java code snippets using weka.classifiers.bayes.NaiveBayesUpdateable (Showing top 20 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
Charset c =
  • Codota IconString charsetName;Charset.forName(charsetName)
  • Codota IconCharset.defaultCharset()
  • Codota IconContentType contentType;contentType.getCharset()
  • Smart code suggestions by Codota
}
origin: nz.ac.waikato.cms.weka/weka-stable

/**
 * Construct a new NBNode
 * 
 * @param header the instances structure of the data we're learning from
 * @param nbWeightThreshold the weight mass to see before allowing naive Bayes
 *          to predict
 * @throws Exception if a problem occurs
 */
public NBNode(Instances header, double nbWeightThreshold) throws Exception {
 m_nbWeightThreshold = nbWeightThreshold;
 m_bayes = new NaiveBayesUpdateable();
 m_bayes.buildClassifier(header);
}
origin: nz.ac.waikato.cms.weka/weka-stable

/**
 * Returns a string describing this classifier
 * @return a description of the classifier suitable for
 * displaying in the explorer/experimenter gui
 */
public String globalInfo() {
 return "Class for a Naive Bayes classifier using estimator classes. This is the "
  +"updateable version of NaiveBayes.\n"
  +"This classifier will use a default precision of 0.1 for numeric attributes "
  +"when buildClassifier is called with zero training instances.\n\n"
  +"For more information on Naive Bayes classifiers, see\n\n"
  + getTechnicalInformation().toString();
}
origin: Waikato/weka-trunk

 /**
  * Main method for testing this class.
  *
  * @param argv the options
  */
 public static void main(String [] argv) {
  runClassifier(new NaiveBayesUpdateable(), argv);
 }
}
origin: nz.ac.waikato.cms.weka/distributedWekaBase

public AggregateableFilteredClassifierUpdateable() {
 m_Classifier = new NaiveBayesUpdateable();
}
origin: Waikato/weka-trunk

/**
 * Return a textual description of the node
 *
 * @return a <code>String</code> value
 */
public String toString() {
 return m_nb.toString();
}
origin: Waikato/weka-trunk

@Override
public void updateNode(Instance inst) throws Exception {
 super.updateNode(inst);
 try {
  m_bayes.updateClassifier(inst);
 } catch (Exception e) {
  e.printStackTrace();
 }
}
origin: nz.ac.waikato.cms.weka/weka-stable

@Override
public double[] getDistribution(Instance inst, Attribute classAtt)
  throws Exception {
 // totalWeight - m_weightSeenAtLastSplitEval is the weight mass
 // observed by this node's NB model
 boolean doNB = m_nbWeightThreshold == 0 ? true : (totalWeight()
   - m_weightSeenAtLastSplitEval > m_nbWeightThreshold);
 if (doNB) {
  return m_bayes.distributionForInstance(inst);
 }
 return super.getDistribution(inst, classAtt);
}
origin: nz.ac.waikato.cms.weka/weka-stable

@Override
public void updateNode(Instance inst) throws Exception {
 String trueClass = inst.classAttribute().value((int) inst.classValue());
 int trueClassIndex = (int) inst.classValue();
 if (majorityClass().equals(trueClass)) {
  m_majClassCorrectWeight += inst.weight();
 }
 if (m_bayes.classifyInstance(inst) == trueClassIndex) {
  m_nbCorrectWeight += inst.weight();
 }
 super.updateNode(inst);
}
origin: nz.ac.waikato.cms.weka/distributedWekaBase

/**
 * Default constructor.
 */
public FilteredClassifierUpdateable() {
 super();
 m_Classifier = new weka.classifiers.bayes.NaiveBayesUpdateable();
 m_Filter = new weka.filters.AllFilter();
}
origin: nz.ac.waikato.cms.weka/weka-stable

/**
 * Return a textual description of the node
 *
 * @return a <code>String</code> value
 */
public String toString() {
 return m_nb.toString();
}
origin: nz.ac.waikato.cms.weka/weka-stable

@Override
public void updateNode(Instance inst) throws Exception {
 super.updateNode(inst);
 try {
  m_bayes.updateClassifier(inst);
 } catch (Exception e) {
  e.printStackTrace();
 }
}
origin: Waikato/weka-trunk

@Override
public double[] getDistribution(Instance inst, Attribute classAtt)
  throws Exception {
 // totalWeight - m_weightSeenAtLastSplitEval is the weight mass
 // observed by this node's NB model
 boolean doNB = m_nbWeightThreshold == 0 ? true : (totalWeight()
   - m_weightSeenAtLastSplitEval > m_nbWeightThreshold);
 if (doNB) {
  return m_bayes.distributionForInstance(inst);
 }
 return super.getDistribution(inst, classAtt);
}
origin: Waikato/weka-trunk

@Override
public void updateNode(Instance inst) throws Exception {
 String trueClass = inst.classAttribute().value((int) inst.classValue());
 int trueClassIndex = (int) inst.classValue();
 if (majorityClass().equals(trueClass)) {
  m_majClassCorrectWeight += inst.weight();
 }
 if (m_bayes.classifyInstance(inst) == trueClassIndex) {
  m_nbCorrectWeight += inst.weight();
 }
 super.updateNode(inst);
}
origin: Waikato/weka-trunk

/**
 * Construct a new NBNode
 * 
 * @param header the instances structure of the data we're learning from
 * @param nbWeightThreshold the weight mass to see before allowing naive Bayes
 *          to predict
 * @throws Exception if a problem occurs
 */
public NBNode(Instances header, double nbWeightThreshold) throws Exception {
 m_nbWeightThreshold = nbWeightThreshold;
 m_bayes = new NaiveBayesUpdateable();
 m_bayes.buildClassifier(header);
}
origin: nz.ac.waikato.cms.weka/weka-stable

/** Creates a default NaiveBayesUpdateable */
public Classifier getClassifier() {
 return new NaiveBayesUpdateable();
}
origin: nz.ac.waikato.cms.weka/weka-stable

 /**
  * Main method for testing this class.
  *
  * @param argv the options
  */
 public static void main(String [] argv) {
  runClassifier(new NaiveBayesUpdateable(), argv);
 }
}
origin: nz.ac.waikato.cms.weka/weka-stable

@Override
protected void printLeafModels(StringBuffer buff) {
 buff.append("NB adaptive" + m_leafNum).append("\n")
   .append(m_bayes.toString());
}
origin: nz.ac.waikato.cms.weka/weka-stable

((NaiveBayesUpdateable)copies[j]).updateClassifier(test.instance(k));
origin: nz.ac.waikato.cms.weka/weka-stable

/**
 * Return the probability for a class value
 *
 * @param classIndex the index of the class value
 * @param instance the instance to generate a probability for
 * @param theSubset the subset to consider
 * @return a probability
 * @exception Exception if an error occurs
 */
public double classProb(int classIndex, Instance instance, int theSubset) 
 throws Exception {
 m_disc.input(instance);
 Instance temp = m_disc.output();
 return m_nb.distributionForInstance(temp)[classIndex];
}
origin: Waikato/weka-trunk

/**
 * Returns a string describing this classifier
 * @return a description of the classifier suitable for
 * displaying in the explorer/experimenter gui
 */
public String globalInfo() {
 return "Class for a Naive Bayes classifier using estimator classes. This is the "
  +"updateable version of NaiveBayes.\n"
  +"This classifier will use a default precision of 0.1 for numeric attributes "
  +"when buildClassifier is called with zero training instances.\n\n"
  +"For more information on Naive Bayes classifiers, see\n\n"
  + getTechnicalInformation().toString();
}
weka.classifiers.bayesNaiveBayesUpdateable

Javadoc

Class for a Naive Bayes classifier using estimator classes. This is the updateable version of NaiveBayes.
This classifier will use a default precision of 0.1 for numeric attributes when buildClassifier is called with zero training instances.

For more information on Naive Bayes classifiers, see

George H. John, Pat Langley: Estimating Continuous Distributions in Bayesian Classifiers. In: Eleventh Conference on Uncertainty in Artificial Intelligence, San Mateo, 338-345, 1995.

BibTeX:

 
@inproceedings{John1995, 
address = {San Mateo}, 
author = {George H. John and Pat Langley}, 
booktitle = {Eleventh Conference on Uncertainty in Artificial Intelligence}, 
pages = {338-345}, 
publisher = {Morgan Kaufmann}, 
title = {Estimating Continuous Distributions in Bayesian Classifiers}, 
year = {1995} 
} 

Valid options are:

 -K 
Use kernel density estimator rather than normal 
distribution for numeric attributes
 -D 
Use supervised discretization to process numeric attributes 
 -O 
Display model in old format (good when there are many classes) 

Most used methods

  • <init>
  • buildClassifier
  • classifyInstance
  • distributionForInstance
  • getTechnicalInformation
    Returns an instance of a TechnicalInformation object, containing detailed information about the tech
  • runClassifier
  • toString
  • updateClassifier

Popular in Java

  • Parsing JSON documents to java classes using gson
  • getExternalFilesDir (Context)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • getSystemService (Context)
  • Rectangle (java.awt)
    A Rectangle specifies an area in a coordinate space that is enclosed by the Rectangle object's top-
  • Charset (java.nio.charset)
    A charset is a named mapping between Unicode characters and byte sequences. Every Charset can decode
  • SecureRandom (java.security)
    This class generates cryptographically secure pseudo-random numbers. It is best to invoke SecureRand
  • Enumeration (java.util)
    A legacy iteration interface.New code should use Iterator instead. Iterator replaces the enumeration
  • ConcurrentHashMap (java.util.concurrent)
    A hash table supporting full concurrency of retrievals and adjustable expected concurrency for updat
  • ExecutorService (java.util.concurrent)
    An Executor that provides methods to manage termination and methods that can produce a Future for tr
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now