title: Java, Weka: NaiveBayesUpdateable: Cannot handle numeric class
body: <p>I am trying to use NaiveBayesUpdateable classifier from Weka. My data contains both nominal and numeric attributes:</p>
  
  <pre><code>  @relation cars
    @attribute country {FR, UK, ...}
    @attribute city {London, Paris, ...}
    @attribute car_make {Toyota, BMW, ...}
    @attribute price numeric   %% car price 
    @attribute sales numeric   %% number of cars sold
  </code></pre>
  
  <p>I need to predict the number of sales (numeric!) based on other attributes. When I run:</p>
  
  <pre><code>    // Train classifier
      ArffLoader loader = new ArffLoader();
      loader.setFile(new File(trainFileName));
      Instances structure = loader.getStructure();
      structure.setClassIndex(structure.numAttributes() - 1);
  
      // train NaiveBayes
      NaiveBayesUpdateable nb = new NaiveBayesUpdateable();
      nb.setUseKernelEstimator(true);
      nb.buildClassifier(structure);
  </code></pre>
  
  <p>I get exception:</p>
  
  <pre><code>  Exception in thread "main" weka.core.UnsupportedAttributeTypeException: weka.classifiers.bayes.NaiveBayesUpdateable: Cannot handle numeric class!
        at weka.core.Capabilities.test(Capabilities.java:954)
        at weka.core.Capabilities.test(Capabilities.java:1110)
        at weka.core.Capabilities.test(Capabilities.java:1023)
        at weka.core.Capabilities.testWithFail(Capabilities.java:1302)
        at weka.classifiers.bayes.NaiveBayes.buildClassifier(NaiveBayes.java:213)
        at foo.bar.IncrementalClassifier.trainEvalPredict(IncrementalClassifier.java:65)
        at foo.bar.IncrementalClassifier.main(IncrementalClassifier.java:36)
  </code></pre>
  
  <p>How can I use numeric attribute for Bayes classification in Weka?</p>