@Test public void testNaiveBayes2() throws IOException { testDataIndexer.index(NaiveBayesCorrectnessTest.createTrainingStream()); NaiveBayesModel model1 = (NaiveBayesModel) new NaiveBayesTrainer().trainModel(testDataIndexer); NaiveBayesModel model2 = persistedModel(model1); String label = "sports"; String[] context = {"bow=manchester", "bow=united"}; Event event = new Event(label, context); testModelOutcome(model1, model2, event); }
@Test public void testNaiveBayes1() throws IOException { testDataIndexer.index(NaiveBayesCorrectnessTest.createTrainingStream()); NaiveBayesModel model1 = (NaiveBayesModel) new NaiveBayesTrainer().trainModel(testDataIndexer); NaiveBayesModel model2 = persistedModel(model1); String label = "politics"; String[] context = {"bow=united", "bow=nations"}; Event event = new Event(label, context); testModelOutcome(model1, model2, event); }
@Test public void testNaiveBayes3() throws IOException { testDataIndexer.index(NaiveBayesCorrectnessTest.createTrainingStream()); NaiveBayesModel model1 = (NaiveBayesModel) new NaiveBayesTrainer().trainModel(testDataIndexer); NaiveBayesModel model2 = persistedModel(model1); String label = "politics"; String[] context = {"bow=united"}; Event event = new Event(label, context); testModelOutcome(model1, model2, event); }
@Test public void testNaiveBayes4() throws IOException { testDataIndexer.index(NaiveBayesCorrectnessTest.createTrainingStream()); NaiveBayesModel model1 = (NaiveBayesModel) new NaiveBayesTrainer().trainModel(testDataIndexer); NaiveBayesModel model2 = persistedModel(model1); String label = "politics"; String[] context = {}; Event event = new Event(label, context); testModelOutcome(model1, model2, event); }