public boolean writeResourcePredictionsToFile(String filename, int trainSize, int neighborSize) {
		List<String> resourceList = this.reader.getResources();
		Map<Integer, List<Integer>> resourcesOfTestUsers = this.reader.getResourcesOfTestUsers(trainSize);
		
		try {
			FileWriter writer = new FileWriter(new File("./data/results/" + filename + ".txt"));
			BufferedWriter bw = new BufferedWriter(writer);
						
			int correctResourceRecommendation = 0;
			int noMatchOfResources = 0;
			List<Integer> positions = new ArrayList<Integer>();
			
			int i=0;
			String helpString = "";
			for (Integer userID : reader.getUniqueUserListFromTestSet(trainSize)) {
				String resultString = (this.reader.getUsers().get(userID) + "-XYZ|");
				
				String givenResourcesOfUser = "";
								
				for (Integer resourceID : resourcesOfTestUsers.get(userID)) {
					givenResourcesOfUser += /*resourceList.get(*/resourceID/*)*/ + ", ";
				}
				
				if (givenResourcesOfUser != "") {
					givenResourcesOfUser = givenResourcesOfUser.substring(0, givenResourcesOfUser.length() - 2);
				}
				
				resultString += givenResourcesOfUser + "|";
				
				
				int[] recommendedResources = this.results.get(i);
				String recString = "";
				int cnt=0;

				for (int recResourceID : recommendedResources) {
				
					if (cnt++ < 10) {
						recString += /*resourceList.get(*/recResourceID/*)*/ + ", ";
						if (resourcesOfTestUsers.get(userID).contains(recResourceID)) {
							helpString += this.reader.getUsers().get(userID) + " " + resourceList.get(recResourceID) + ", ";
						}
					} else {
						break;
					}
					
					/*if (resourcesOfUsers.get(userID).contains(recResourceID)) {
						correctResourceRecommendation++;
						positions.add(cnt);
					}*/
				}
				
				if (recString.equals("")) {
					noMatchOfResources++;
				} else {
					recString = recString.substring(0, recString.length() - 2);
				}
				
				resultString += recString + "\n";
				helpString += "\n";
				bw.write(resultString);
				i++;
			}
			
			bw.flush();
			bw.close();
			writer.close();

			writer = new FileWriter(new File("./data/results/" + filename + "_positions" + (neighborSize != -1 ? ("_" + neighborSize) : "" ) + ".txt"));
			bw = new BufferedWriter(writer);
			
			//String recPositions = positions.toString().substring(1, positions.toString().length()-1);
			//bw.write(recPositions);
			
			bw.write(helpString);
			
			bw.flush();
			bw.close();
						
			return true;
		} catch (IOException e) {
			e.printStackTrace();
		}
		
		return false;
	}