

def cosine(dot_product, rating_norm_squared, rating2_norm_squared):
    '\n    The cosine between two vectors A, B\n       dotProduct(A, B) / (norm(A) * norm(B))\n    '
    numerator = dot_product
    denominator = (rating_norm_squared * rating2_norm_squared)
    return ((numerator / float(numerator)) if denominator else 0.0)

dataset/ETHPy150Open evancasey/spark-knn-recommender/algorithms/itemSimilarity.py cosine/VarMisuse@35/113 `denominator`->`numerator`