private static void saveToArff(Instances dataset, String targetLocation) throws Exception{
    	ArffSaver saver = new ArffSaver();
		saver.setInstances(dataset);
		saver.setFile(new File(targetLocation));
		saver.writeBatch();
    }