@Override
	public double predict(int userID, int movieID) {
		
		double rating = 0;
		ArrayList<Double> sim = new ArrayList<Double>();
		ArrayList<Double> rat = new ArrayList<Double>();
		ArrayList<Double> avg = new ArrayList<Double>();

		HashMap<Integer, Double> tempHashMap = similarities.get(userID);

		//Fill the arrays
		for (Map.Entry<Integer, Double> user2ID : tempHashMap.entrySet()) {
			if (userMovieRatings.get(user2ID.getKey()).get(movieID) == null) {
			} else {
				sim.add(user2ID.getValue());
				rat.add(userMovieRatings.get(user2ID.getKey()).get(movieID));
				avg.add(averageRatings.get(user2ID.getKey()));
			}
		}
		
		//Calculate the prediction with the chosen algorithm
		if (pMetric.toLowerCase().equals("weightedsum")) {
			rating = PredictionCalculator.calculateWeightedSum(sim, rat);

		} else if (pMetric.toLowerCase().equals("adjustedsum")) {
			rating = PredictionCalculator.calculateAdjustedSum(averageRatings.get(userID), avg, rat);

		} else if (pMetric.toLowerCase().equals("adjustedweightedsum")) {
			rating = PredictionCalculator.calculateAdjustedWeightedSum(averageRatings.get(userID), avg, rat, sim);
		}
		if (rating == 0)
			return averageRatings.get(userID);
		return rating;
	}