title: Java Naive Bayes Classifier evaluation
body: <p>i am new to weka data mining and evaluation.So far i have read data set.I want to predict my data based on data set.As a example i have used weather data set provided by weka tool.So i have used Naive Bayes Classifier for classification.Now i got probability values for my attributes.Now i want to predict data using data-set. As example when i give <code>sunny,70,85,TRUE</code> then i want to get probability of class value.So far i have done this part.Can anyone tell me how to used Naive Bayes classifier for data evaluation.</p>
  
  <pre><code>public static void ArfLoader(){
           ArffLoader loader = new ArffLoader();
           try {
               loader.setFile(new File("sampleData.txt"));
               Instances structure = loader.getStructure();
               structure.setClassIndex(structure.numAttributes() - 1);
  
               NaiveBayesUpdateable nb = new NaiveBayesUpdateable();
               nb.buildClassifier(structure);
               Instance current;
               while ((current = loader.getNextInstance(structure)) != null){
                   nb.updateClassifier(current); 
               }
  
               System.out.print(nb); 
  
  
          } catch (IOException e) {
              // TODO Auto-generated catch block
              e.printStackTrace();
          } catch (Exception e) {
              // TODO Auto-generated catch block
              e.printStackTrace();
          }
  
  
      }
  </code></pre>
  
  <p>Then this is my data set.</p>
  
  <pre><code>@relation weather
  
  @attribute outlook {sunny, overcast, rainy}
  @attribute temperature real
  @attribute humidity real
  @attribute windy {TRUE, FALSE}
  @attribute play {yes, no}
  
  @data
  sunny,85,85,FALSE,no
  sunny,80,90,TRUE,no
  overcast,83,86,FALSE,yes
  rainy,70,96,FALSE,yes
  rainy,68,80,FALSE,yes
  rainy,65,70,TRUE,no
  overcast,64,65,TRUE,yes
  sunny,72,95,FALSE,no
  sunny,69,70,FALSE,yes
  rainy,75,80,FALSE,yes
  sunny,75,70,TRUE,yes
  overcast,72,90,TRUE,yes
  overcast,81,75,FALSE,yes
  rainy,71,91,TRUE,no
  </code></pre>