List of usage examples for weka.classifiers.meta Bagging buildClassifier
@Override public void buildClassifier(Instances data) throws Exception
From source file:AaronTest.TransformEnsembleExperiments.java
public static void ensembleTest(Instances train, Instances test) { //create a bagging ensemble and give it 1-NN as a base. Bagging bag = new Bagging(); bag.setClassifier(new IBk(1)); //train our bag try {/*w ww. j ava 2 s .co m*/ bag.buildClassifier(train); } catch (Exception ex) { System.out.println("Ex: " + ex); } double average = utilities.ClassifierTools.accuracy(test, bag); System.out.println("Average correct = " + average); }