Add extended logging to collaborative_recommender.

This commit is contained in:
mlopatka 2018-05-15 19:15:59 +02:00
Родитель 21d1567e49
Коммит ffa68096b1
1 изменённых файлов: 7 добавлений и 1 удалений

Просмотреть файл

@ -115,4 +115,10 @@ class CollaborativeRecommender(AbstractRecommender):
sorted_dists = sorted(distances.items(), sorted_dists = sorted(distances.items(),
key=op.itemgetter(1), key=op.itemgetter(1),
reverse=True) reverse=True)
return [(s[0], s[1]) for s in sorted_dists[:limit]] recommendations = [(s[0], s[1]) for s in sorted_dists[:limit]]
log_data = (str([r[0] for r in recommendations]))
logger.info("collaborative_recommender_triggered, "
"guids: [%s]" % log_data)
return recommendations