public void writeModelToFile(String fileName) throws IOException {

		BufferedWriter out = new BufferedWriter(new FileWriter(new File(fileName)));

		//write smoothingValue
		out.write(">smoothingValue\n");
		out.write(Double.toString(smoothingValue) + "\n");

		//write featureValueRelativeRoleFrequency
		out.write(">frequencies: featureType\tfeatureValue\tfrequency\t[relativeFrequency]\n");
		//role#featureType:featureValue:probability
		//String valueFrequency = "";
		int frequency;
		String featureValue;
		//Double probability = 0.0;
		String relativeFrequency;
		for (String featureType : featureValueFrequency.keySet()) {
			//for (String featureValue : featureValueRelativeRoleFrequency.get(featureType).keySet()) {
			for (Entry<String, Integer> valueFrequency : featureValueFrequency.get(featureType).entrySet()) {
				frequency = valueFrequency.getValue();
				featureValue = valueFrequency.getKey();
				try {
					relativeFrequency = Double.toString(Math.exp(featureValueRelativeRoleFrequency.get(featureType).get(featureValue)));
				} catch (NullPointerException e) {
					relativeFrequency = Double.toString(0.0);
				}
				out.write(featureType + modelOutSplitChar + featureValue + modelOutSplitChar + frequency + modelOutSplitChar + relativeFrequency + "\n");
			}
			//}
		}
		out.close();
	}