public static void writeAverageMetrics(String outputFile, int k, double size, boolean calcTags, boolean endLine) {
		try {
			FileWriter writer = new FileWriter(new File("./data/metrics/" + outputFile + "_avg.txt"), true);
			BufferedWriter bw = new BufferedWriter(writer);
			double recall = recallSum / size;
			double precision = precisionSum / size;
			bw.write(Double.toString(recall).replace('.', ',') + ";");		
			bw.write(Double.toString(precision).replace('.', ',') + ";");		
			//bw.write(Double.toString((fMeasureSum / size)).replace('.', ',') + ";");
			bw.write(Double.toString(2.0 * recall * precision / (recall + precision == 0 ? 1.0 : recall + precision)).replace('.', ',') + ";");
			bw.write(Double.toString((mrrSum / size)).replace('.', ',') + ";");		
			bw.write(Double.toString((mapSum / size)).replace('.', ',') + ";");
			bw.write(Double.toString((nDCGSum / size)).replace('.', ',') + ";");
			bw.write(Double.toString((userCoverageSum / size)).replace('.', ','));
			if (!calcTags) {
				bw.write(";");
				bw.write(Double.toString((diversitySum / size)).replace('.', ',') + ";");		
				bw.write(Double.toString((serendipitySum / size)).replace('.', ',') + ";");
			}
			if (endLine)
				bw.write("\n");
			
			bw.write("\n");
			bw.close();
			
			resetMetrics();
		} catch (IOException e) {
			e.printStackTrace();
		}
	}