//return;
}
if(true) {
ce = new ClassificationEvaluator();
MultinomialNaiveBayes mnb = new MultinomialNaiveBayes(bagEvents);
Element elem = mnb.toXML();
Document doc = new Document(elem);
Serializer ser = new Serializer(System.out);
//ser.setIndent(2);
ser.write(doc);
mnb = new MultinomialNaiveBayes(elem);
elem = mnb.toXML();
doc = new Document(elem);
ser = new Serializer(System.out);
//ser.setIndent(2);
ser.write(doc);
for(int i=0;i<testBagEvents.size();i++) {
BagEvent be = testBagEvents.get(i);
//Map<String,Double> results = mnb.testBag(be.getClassLabel(), be.getFeatures());
Map<String,Double> results = mnb.testBag(be.getFeatures());
System.out.println(be.getClassLabel() + "\t" + mnb.testBag(be.getFeatures()));
ce.logEvent(be.getClassLabel(), mnb.bestResult(results));
if(!be.getClassLabel().equals(mnb.bestResult(results))) {
System.out.println(be.getFeatures());
System.out.println(bagsToSentences.get(be.getFeatures()));
}
}
System.out.println(ce.getAccuracy());