def cosine(dot_product,rating_norm_squared,rating2_norm_squared):
    numerator = dot_product
    denominator = rating_norm_squared * rating2_norm_squared

    return (numerator / (float(denominator))) if denominator else 0.0
Always returns a floating-point number.
dataset/ETHPy150Open evancasey/spark-knn-recommender/algorithms/itemSimilarity.py/cosine--crossover with--dataset/ETHPy150Open skyostil/tracy/src/generator/Cheetah/Tools/MondoReport.py/mean