public static double calculateCosineSimilarity(Double[] ratingsOne, Double[] ratingsTwo) {
		double enumerator = 0, denominatorOne = 0, denominatorTwo = 0;

		for (int i = 0; i < ratingsOne.length; i++) {
			enumerator += ratingsOne[i] * ratingsTwo[i];
			denominatorOne += Math.pow(ratingsOne[i], 2);
			denominatorTwo += Math.pow(ratingsTwo[i], 2);
		}

		if (enumerator == 0 || denominatorOne == 0 || denominatorTwo == 0) {
			return 0;
		} else {
			return (double) enumerator / (Math.sqrt(denominatorOne) * Math.sqrt(denominatorTwo));
		}
	}