@Override
    public LibSVMModel<Event> train(Dataset<Event> dataset, Map<String, Provenance> instanceProvenance) {
        for (Pair<String,Long> p : dataset.getOutputInfo().outputCountsIterable()) {
            if (p.getA().equals(EventType.ANOMALOUS.toString()) && (p.getB() > 0)) {
                throw new IllegalArgumentException("LibSVMAnomalyTrainer only supports EXPECTED events at training time.");
            }
        }
        return super.train(dataset,instanceProvenance);
    }
@Test
    public void gaussianDataTest() {
        Pair<Dataset<Event>,Dataset<Event>> pair = AnomalyDataGenerator.gaussianAnomaly(1000,0.2);

        SVMParameters<Event> params = new SVMParameters<>(new SVMAnomalyType(SVMAnomalyType.SVMMode.ONE_CLASS), KernelType.RBF);
        params.setGamma(1.0);
        params.setNu(0.1);

        LibSVMAnomalyTrainer trainer = new LibSVMAnomalyTrainer(params);

        LibSVMModel<Event> model = trainer.train(pair.getA());

        AnomalyEvaluator evaluator = new AnomalyEvaluator();

        AnomalyEvaluation evaluation = evaluator.evaluate(model,pair.getB());

        assertEquals(200,evaluation.getTruePositives());
        assertTrue(650 < evaluation.getTrueNegatives());
        assertEquals(0,evaluation.getFalseNegatives());

        String confusion = evaluation.confusionString();
        String output = evaluation.toString();

        // logging a few outputs for easy checking, and to prevent dead code elimination.
        logger.finer(confusion);
        logger.finer(output);

        // Test serialization
        Helpers.testModelSerialization(model,Event.class);

        // Test protobuf serialization
        Helpers.testModelProtoSerialization(model, Event.class, pair.getB());
    }