public AveragingCombiner() {}
@Test
    public void averagingCombinerTest() {
        Dataset<Regressor> abcDataset = abcDataset();

        Model<Regressor> fiveModel = fiveTrainer.train(abcDataset);
        Model<Regressor> threeModel = threeTrainer.train(abcDataset);
        Model<Regressor> oneModel = oneTrainer.train(abcDataset);

        List<Model<Regressor>> modelList = new ArrayList<>();

        Example<Regressor> testExample = new ArrayExample<>(new Regressor(abc,new double[]{-1,-1,-1}),new String[]{"X_0","X_1","X_2"}, new double[]{1,2,3});

        // Combiner predicts the average
        modelList.add(fiveModel);
        modelList.add(threeModel);
        modelList.add(oneModel);
        WeightedEnsembleModel<Regressor> ensemble = WeightedEnsembleModel.createEnsembleFromExistingModels("average",modelList, averagingCombiner);
        assertEquals(3,ensemble.getNumModels());
        Prediction<Regressor> prediction = ensemble.predict(testExample);
        Regressor target = new Regressor(abc,new double[]{3,3,3});
        assertArrayEquals(prediction.getOutput().getValues(),target.getValues());
        modelList.clear();

        // Weights affect the averaging
        modelList.add(fiveModel);
        modelList.add(threeModel);
        modelList.add(oneModel);
        ensemble = WeightedEnsembleModel.createEnsembleFromExistingModels("weighted",modelList, averagingCombiner,new float[]{3,1,1});
        assertEquals(3,ensemble.getNumModels());
        prediction = ensemble.predict(testExample);
        target = new Regressor(abc,new double[]{3.8,3.8,3.8});
        assertArrayEquals(prediction.getOutput().getValues(),target.getValues());
        modelList.clear();

        Helpers.testModelSerialization(ensemble,Regressor.class);
    }