Skip to content

Instantly share code, notes, and snippets.

@fitomad fitomad/tc_recommender_items.py Secret

Created Feb 18, 2020
Embed
What would you like to do?
...
# Creamos el modelo
model = tc.recommender.item_similarity_recommender.create(training_data,
user_id='user_id',
item_id='show_id')
# Series similares a Stranger Things
recommendations = model.get_similar_items(items=[ 66732 ])
...
#
# Y aquí la recomendación si te ha gustado Stranger Things
#
+---------+---------+--------------------+------+----------------+------+
| show_id | similar | score | rank | name | year |
+---------+---------+--------------------+------+----------------+------+
| 66732 | 1396 | 0.6000000238418579 | 1 | Breaking Bad | 2008 |
| 66732 | 60573 | 0.5 | 5 | Silicon Valley | 2014 |
| 66732 | 65494 | 0.3999999761581421 | 6 | The Crown | 2016 |
| 66732 | 87108 | 0.375 | 7 | Chernobyl | 2019 |
| 66732 | 71446 | 0.375 | 8 | Money Heist | 2017 |
| 66732 | 63247 | 0.3333333134651184 | 9 | Westworld | 2016 |
| 66732 | 42009 | 0.3333333134651184 | 10 | Black Mirror | 2011 |
+---------+---------+--------------------+------+----------------+------+
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.