SlideShare una empresa de Scribd logo
1 de 24
Descargar para leer sin conexión
DEEP RECOMMENDATIONS
ANDREW CLEGG
IN A NUTSHELL
ABOUT ME
• Etsy, Pearson, Last.fm,
AstraZeneca, consulting
• Academic background:
bioinformatics, information
retrieval, natural language
processing (UCL/Birkbeck)
• Main interests: search,
recommendations,
personalization
• @andrew_clegg
• http://andrewclegg.org/
DEEP PRODUCT RECOMMENDATIONS
ABOUT THIS TALK
• Framing recommendation tasks in terms of neural networks and
deep learning
• Some network architectures from the literature
• Why use neural methods at all?
BIG CAVEAT
This is a broad overview, and I’m not a specialist (yet)
BEAR WITH ME, I’M A DEEP
LEARNING NOOB.
”
“
COMMON RECOMMENDATION TASKS
AND HOW TO FRAME THEM IN DEEP LEARNING TERMS
NON-PERSONALIZED, CONTEXT-BASED
SIMILAR ITEMS BASED ON CO-OCCURRENCE
• “Context” = liked by same user, bought in same order, etc.
• Item-based collaborative filtering
• Cold-start recommendations for new users
• “Related items” / “Buy these items together”
• Also useful for nearest-neighbours classification (e.g. tag prediction)
• Classically based on item-item matrix factorization
NEURAL INTERPRETATION
SIMILAR ITEMS BASED ON CO-OCCURRENCE
• Items that co-occur should have embeddings that are close in space
• Key point: similar goal to word2vec
• “Item2Vec: Neural Item Embedding for Collaborative Filtering”
• Barkan & Koenigstein (Microsoft)
• Train network to differentiate between items that did occur in same
context as training item, and items that didn’t occur (skip-gram)
SESSION-BASED, ORDER-AWARE
PREDICTING NEXT-VIEWED ITEMS
• Contextual recommendations based on recent/current activity
• Given a user’s session so far, what are they most likely to want next?
• Classical methods include:
• Markov decision processes
• Bayesian scoring with Thompson sampling
• Models based on sum or average of events so far (not order-aware)
NEURAL INTERPRETATION
PREDICTING NEXT-VIEWED ITEMS
• Recurrent Neural Networks and their relatives (LSTMs, GRUs etc.)
• Key point: similar to sampling from a language model
• Session is “sentence”, items are “words”, catalogue is “vocabulary”
• “Session-based Recommendations with Recurrent Neural Networks”
• Hidasi et al (Gravity R&D / Telefonica Research) — GRU4Rec
• “Improved Recurrent Neural Networks for Session-based
Recommendations”
• Tan et al (A*STAR)
PERSONALIZED, HISTORY-BASED
BEHAVIOURAL ITEM RECOMMENDATIONS
• User-based collaborative filtering
• “Users like you also liked…”
• Explicit or implicit feedback (likes/ratings vs. viewed/not-viewed)
• Typical approach: user-item matrix factorization
• Map users and items into same lower-dimensional space
• Rating prediction or nearest-neighbour search
NEURAL INTERPRETATION
BEHAVIOURAL ITEM RECOMMENDATIONS
• Learn embeddings for users and items such that:
• user · item approximates rating, or…
• user · viewed item > user · non-viewed item
• Or more generally:
• f(user, item) approximates rating, or…
• f(user, viewed item) > f(user, non-viewed item)
• Key point: easy to replicate factor models, then add more layers
NEURAL INTERPRETATION: SIMPLE APPROACH
BEHAVIOURAL ITEM RECOMMENDATIONS
class CFModel(Sequential):
def __init__(self, n_users, m_items, k_factors, **kwargs):
P = Sequential()
P.add(Embedding(n_users, k_factors, input_length=1))
P.add(Reshape((k_factors,)))
Q = Sequential()
Q.add(Embedding(m_items, k_factors, input_length=1))
Q.add(Reshape((k_factors,)))
super(CFModel, self).__init__(**kwargs)
self.add(Merge([P, Q], mode='dot', dot_axes=1))
• github: bradleypallen/keras-movielens-cf based on example from
fenris.org blog post: “Collaborative Filtering in Keras”
• Deeper version: “Recommending Movies with Deep Learning”
• Richard Weiss (blog post)
NEURAL INTERPRETATION: TRIPLET LEARNING
BEHAVIOURAL ITEM RECOMMENDATIONS
def build_model(num_users, num_items, latent_dim):
positive_item_input = Input((1, ), name='positive_item_input')
negative_item_input = Input((1, ), name='negative_item_input')
# Shared embedding layer for positive and negative items
item_embedding_layer = Embedding(
num_items, latent_dim, name='item_embedding', input_length=1)
user_input = Input((1, ), name='user_input')
positive_item_embedding = Flatten()(item_embedding_layer(positive_item_input))
negative_item_embedding = Flatten()(item_embedding_layer(negative_item_input))
user_embedding = Flatten()(Embedding(
num_users, latent_dim, name='user_embedding', input_length=1)(
user_input))
loss = merge(
[positive_item_embedding, negative_item_embedding, user_embedding],
mode=bpr_triplet_loss,
name='loss',
output_shape=(1, ))
model = Model(
input=[positive_item_input, negative_item_input, user_input], output=loss)
model.compile(loss=identity_loss, optimizer=Adam())
return model
NEURAL INTERPRETATION: TRIPLET LEARNING
BEHAVIOURAL ITEM RECOMMENDATIONS
def bpr_triplet_loss(X):
positive_item_latent, negative_item_latent, user_latent = X
# Bayesian Personalized Ranking loss
loss = 1.0 - K.sigmoid(
K.sum(user_latent * positive_item_latent, axis=-1, keepdims=True) -
K.sum(user_latent * negative_item_latent, axis=-1, keepdims=True))
return loss
• github: maciejkula/triplet_recommendations_keras
• For each (user, item_pos, item_neg) triplet:
• Learn to score (user, item_pos) higher than (user, item_neg)
• Loss function from “BPR: Bayesian Personalized Ranking from
Implicit Feedback” — Rendle et al (Univ. Of Hildesheim)
PERSONALIZED, HISTORY & CONTENT-BASED
HYBRID RECOMMENDATIONS
• Blend of collaborative filtering based on behavioural data, and
supervised learning based on features (of item, of user, of context)
• State-of-the-art for many recommendation tasks
• “Factorization Machines”
• Steffen Rendle (Osaka University) — LibFM
• “Metadata Embeddings for User and Item Cold-start
Recommendations”
• Maciej Kula (Lyst) — LightFM
NEURAL INTERPRETATION: WIDE & DEEP MODELS
HYBRID RECOMMENDATIONS
• Deep neural networks can learn to generalize to both similar users
and similar items
• But shallow, sparse models can learn specific effects easily
• So, combine both into one model
• “Wide & Deep Learning for Recommender Systems”
• Cheng et al (Google) — see also tutorial on TensorFlow website
HYBRID RECOMMENDATIONS
NEURAL INTERPRETATION: WIDE & DEEP MODELS
Image from Wide & Deep Learning tutorial on tensorflow.org
NEURAL INTERPRETATION: TWO-STAGE RECOMMENDERS
HYBRID RECOMMENDATIONS
• Alternative approach — split task into two steps:
1. Classification model to select shortlist of items likely to be clicked
2. Ranking model to determine correct display order for these items
• Both steps can use personalized features about the user
• Each one is an easier task than attempting to rank entire catalogue
• “Deep Neural Networks for YouTube Recommendations”
• Covington et al (Google)
THE BIGGER PICTURE
WHY USE DEEP LEARNING AT ALL?
DEEP LEARNING ISN’T AN AUTOMATIC WIN
A WORD OF WARNING
• Deep learning won’t necessarily beat best classical models!
• DL models can be harder to train
• They often require a lot more tedious hyperparameter tuning
• How many layers? How wide should each be?
• What kind of activation function(s)?
• How much regularization, and where?
• What learning algorithm to use? With what settings? Etc etc etc…
WHY SHOULD I CONSIDER DEEP LEARNING?
SO WHAT ARE THE ADVANTAGES?
• DL models are flexible and highly composable
• Easy to use smaller models as components in larger ones, e.g.:
• Plug output of LSTM model of session activity into input of deep
collaborative filtering model
• Plug output of image feature extraction model into input of
personalized reranking models
• Take weights learnt in one model and use them in another, e.g.:
• Embeddings from word2vec in a content-based recommender
WHY SHOULD I CONSIDER DEEP LEARNING?
SO WHAT ARE THE ADVANTAGES?
• DL toolkits keep getting better and better
• Take advantage of GPUs (single/multiple/whole cluster…)
• Easy to take existing models and slightly extend/modify them
• Easy to try new loss functions, network architectures etc.
• No need to get bogged down in C code or maths
• Models and whole approaches can be transferred between domains
• So much example code out there to follow
ANY QUESTIONS?
THANKS!
• Feel free to grab me
afterwards to chat about
anything
• Or ping me on Twitter:
• @andrew_clegg
• Special thanks to Maciej Kula
for his suggestions

Más contenido relacionado

Similar a Andrew Clegg, Data Scientician & Machine Learning Engine-Driver: "Deep product recommendations with Keras and TensorFlow"

Enriching Solr with Deep Learning for a Question Answering System - Sanket Sh...
Enriching Solr with Deep Learning for a Question Answering System - Sanket Sh...Enriching Solr with Deep Learning for a Question Answering System - Sanket Sh...
Enriching Solr with Deep Learning for a Question Answering System - Sanket Sh...Lucidworks
 
Олександр Обєдніков “Рекомендательные системы”
Олександр Обєдніков “Рекомендательные системы”Олександр Обєдніков “Рекомендательные системы”
Олександр Обєдніков “Рекомендательные системы”Dakiry
 
The Universal Recommender
The Universal RecommenderThe Universal Recommender
The Universal RecommenderPat Ferrel
 
Introduction to Machine Learning
Introduction to Machine LearningIntroduction to Machine Learning
Introduction to Machine LearningRahul Jain
 
Query-time Nonparametric Regression with Temporally Bounded Models - Patrick ...
Query-time Nonparametric Regression with Temporally Bounded Models - Patrick ...Query-time Nonparametric Regression with Temporally Bounded Models - Patrick ...
Query-time Nonparametric Regression with Temporally Bounded Models - Patrick ...Lucidworks
 
Validating Ideas Through Prototyping
Validating Ideas Through PrototypingValidating Ideas Through Prototyping
Validating Ideas Through PrototypingChris Risdon
 
Get the most out of getting out of the building
Get the most out of getting out of the buildingGet the most out of getting out of the building
Get the most out of getting out of the buildingTodd Warren
 
Content based recommendation systems
Content based recommendation systemsContent based recommendation systems
Content based recommendation systemsAravindharamanan S
 
Learn Learning + Prototype Testing
Learn Learning + Prototype TestingLearn Learning + Prototype Testing
Learn Learning + Prototype TestingDave Hora
 
Multi task learning stepping away from narrow expert models 7.11.18
Multi task learning stepping away from narrow expert models 7.11.18Multi task learning stepping away from narrow expert models 7.11.18
Multi task learning stepping away from narrow expert models 7.11.18Cloudera, Inc.
 
Recommandation systems -
Recommandation systems - Recommandation systems -
Recommandation systems - Yousef Fadila
 
Recsys 2016 tutorial: Lessons learned from building real-life recommender sys...
Recsys 2016 tutorial: Lessons learned from building real-life recommender sys...Recsys 2016 tutorial: Lessons learned from building real-life recommender sys...
Recsys 2016 tutorial: Lessons learned from building real-life recommender sys...Xavier Amatriain
 
Designing and Implementing Search Solutions
Designing and Implementing Search SolutionsDesigning and Implementing Search Solutions
Designing and Implementing Search SolutionsFindwise
 
RecSys 2015 Tutorial - Scalable Recommender Systems: Where Machine Learning m...
RecSys 2015 Tutorial - Scalable Recommender Systems: Where Machine Learning m...RecSys 2015 Tutorial - Scalable Recommender Systems: Where Machine Learning m...
RecSys 2015 Tutorial - Scalable Recommender Systems: Where Machine Learning m...Joaquin Delgado PhD.
 
RecSys 2015 Tutorial – Scalable Recommender Systems: Where Machine Learning...
 RecSys 2015 Tutorial – Scalable Recommender Systems: Where Machine Learning... RecSys 2015 Tutorial – Scalable Recommender Systems: Where Machine Learning...
RecSys 2015 Tutorial – Scalable Recommender Systems: Where Machine Learning...S. Diana Hu
 
Near Real-time Web-Page Recs Using Content Features
Near Real-time Web-Page Recs Using Content FeaturesNear Real-time Web-Page Recs Using Content Features
Near Real-time Web-Page Recs Using Content FeaturesAshok Venkatesan
 

Similar a Andrew Clegg, Data Scientician & Machine Learning Engine-Driver: "Deep product recommendations with Keras and TensorFlow" (20)

Enriching Solr with Deep Learning for a Question Answering System - Sanket Sh...
Enriching Solr with Deep Learning for a Question Answering System - Sanket Sh...Enriching Solr with Deep Learning for a Question Answering System - Sanket Sh...
Enriching Solr with Deep Learning for a Question Answering System - Sanket Sh...
 
Олександр Обєдніков “Рекомендательные системы”
Олександр Обєдніков “Рекомендательные системы”Олександр Обєдніков “Рекомендательные системы”
Олександр Обєдніков “Рекомендательные системы”
 
The Universal Recommender
The Universal RecommenderThe Universal Recommender
The Universal Recommender
 
Discovering discovery
Discovering discoveryDiscovering discovery
Discovering discovery
 
Introduction to Machine Learning
Introduction to Machine LearningIntroduction to Machine Learning
Introduction to Machine Learning
 
Query-time Nonparametric Regression with Temporally Bounded Models - Patrick ...
Query-time Nonparametric Regression with Temporally Bounded Models - Patrick ...Query-time Nonparametric Regression with Temporally Bounded Models - Patrick ...
Query-time Nonparametric Regression with Temporally Bounded Models - Patrick ...
 
Validating Ideas Through Prototyping
Validating Ideas Through PrototypingValidating Ideas Through Prototyping
Validating Ideas Through Prototyping
 
Introduction
IntroductionIntroduction
Introduction
 
Machine Learning & Apache Mahout
Machine Learning & Apache MahoutMachine Learning & Apache Mahout
Machine Learning & Apache Mahout
 
Get the most out of getting out of the building
Get the most out of getting out of the buildingGet the most out of getting out of the building
Get the most out of getting out of the building
 
Content based recommendation systems
Content based recommendation systemsContent based recommendation systems
Content based recommendation systems
 
E3 chap-09
E3 chap-09E3 chap-09
E3 chap-09
 
Learn Learning + Prototype Testing
Learn Learning + Prototype TestingLearn Learning + Prototype Testing
Learn Learning + Prototype Testing
 
Multi task learning stepping away from narrow expert models 7.11.18
Multi task learning stepping away from narrow expert models 7.11.18Multi task learning stepping away from narrow expert models 7.11.18
Multi task learning stepping away from narrow expert models 7.11.18
 
Recommandation systems -
Recommandation systems - Recommandation systems -
Recommandation systems -
 
Recsys 2016 tutorial: Lessons learned from building real-life recommender sys...
Recsys 2016 tutorial: Lessons learned from building real-life recommender sys...Recsys 2016 tutorial: Lessons learned from building real-life recommender sys...
Recsys 2016 tutorial: Lessons learned from building real-life recommender sys...
 
Designing and Implementing Search Solutions
Designing and Implementing Search SolutionsDesigning and Implementing Search Solutions
Designing and Implementing Search Solutions
 
RecSys 2015 Tutorial - Scalable Recommender Systems: Where Machine Learning m...
RecSys 2015 Tutorial - Scalable Recommender Systems: Where Machine Learning m...RecSys 2015 Tutorial - Scalable Recommender Systems: Where Machine Learning m...
RecSys 2015 Tutorial - Scalable Recommender Systems: Where Machine Learning m...
 
RecSys 2015 Tutorial – Scalable Recommender Systems: Where Machine Learning...
 RecSys 2015 Tutorial – Scalable Recommender Systems: Where Machine Learning... RecSys 2015 Tutorial – Scalable Recommender Systems: Where Machine Learning...
RecSys 2015 Tutorial – Scalable Recommender Systems: Where Machine Learning...
 
Near Real-time Web-Page Recs Using Content Features
Near Real-time Web-Page Recs Using Content FeaturesNear Real-time Web-Page Recs Using Content Features
Near Real-time Web-Page Recs Using Content Features
 

Más de Dataconomy Media

Data Natives Paris v 10.0 | "Blockchain in Healthcare" - Lea Dias & David An...
Data Natives Paris v 10.0 | "Blockchain in Healthcare" - Lea Dias & 	David An...Data Natives Paris v 10.0 | "Blockchain in Healthcare" - Lea Dias & 	David An...
Data Natives Paris v 10.0 | "Blockchain in Healthcare" - Lea Dias & David An...Dataconomy Media
 
Data Natives Frankfurt v 11.0 | "Competitive advantages with knowledge graphs...
Data Natives Frankfurt v 11.0 | "Competitive advantages with knowledge graphs...Data Natives Frankfurt v 11.0 | "Competitive advantages with knowledge graphs...
Data Natives Frankfurt v 11.0 | "Competitive advantages with knowledge graphs...Dataconomy Media
 
Data Natives Frankfurt v 11.0 | "Can we be responsible for misuse of data & a...
Data Natives Frankfurt v 11.0 | "Can we be responsible for misuse of data & a...Data Natives Frankfurt v 11.0 | "Can we be responsible for misuse of data & a...
Data Natives Frankfurt v 11.0 | "Can we be responsible for misuse of data & a...Dataconomy Media
 
Data Natives Munich v 12.0 | "How to be more productive with Autonomous Data ...
Data Natives Munich v 12.0 | "How to be more productive with Autonomous Data ...Data Natives Munich v 12.0 | "How to be more productive with Autonomous Data ...
Data Natives Munich v 12.0 | "How to be more productive with Autonomous Data ...Dataconomy Media
 
Data Natives meets DataRobot | "Build and deploy an anti-money laundering mo...
Data Natives meets DataRobot |  "Build and deploy an anti-money laundering mo...Data Natives meets DataRobot |  "Build and deploy an anti-money laundering mo...
Data Natives meets DataRobot | "Build and deploy an anti-money laundering mo...Dataconomy Media
 
Data Natives Munich v 12.0 | "Political Data Science: A tale of Fake News, So...
Data Natives Munich v 12.0 | "Political Data Science: A tale of Fake News, So...Data Natives Munich v 12.0 | "Political Data Science: A tale of Fake News, So...
Data Natives Munich v 12.0 | "Political Data Science: A tale of Fake News, So...Dataconomy Media
 
Data Natives Vienna v 7.0 | "Building Kubernetes Operators with KUDO for Dat...
Data Natives Vienna v 7.0  | "Building Kubernetes Operators with KUDO for Dat...Data Natives Vienna v 7.0  | "Building Kubernetes Operators with KUDO for Dat...
Data Natives Vienna v 7.0 | "Building Kubernetes Operators with KUDO for Dat...Dataconomy Media
 
Data Natives Vienna v 7.0 | "The Ingredients of Data Innovation" - Robbert de...
Data Natives Vienna v 7.0 | "The Ingredients of Data Innovation" - Robbert de...Data Natives Vienna v 7.0 | "The Ingredients of Data Innovation" - Robbert de...
Data Natives Vienna v 7.0 | "The Ingredients of Data Innovation" - Robbert de...Dataconomy Media
 
Data Natives Cologne v 4.0 | "The Data Lorax: Planting the Seeds of Fairness...
Data Natives Cologne v 4.0  | "The Data Lorax: Planting the Seeds of Fairness...Data Natives Cologne v 4.0  | "The Data Lorax: Planting the Seeds of Fairness...
Data Natives Cologne v 4.0 | "The Data Lorax: Planting the Seeds of Fairness...Dataconomy Media
 
Data Natives Cologne v 4.0 | "How People Analytics Can Reveal the Hidden Aspe...
Data Natives Cologne v 4.0 | "How People Analytics Can Reveal the Hidden Aspe...Data Natives Cologne v 4.0 | "How People Analytics Can Reveal the Hidden Aspe...
Data Natives Cologne v 4.0 | "How People Analytics Can Reveal the Hidden Aspe...Dataconomy Media
 
Data Natives Amsterdam v 9.0 | "Ten Little Servers: A Story of no Downtime" -...
Data Natives Amsterdam v 9.0 | "Ten Little Servers: A Story of no Downtime" -...Data Natives Amsterdam v 9.0 | "Ten Little Servers: A Story of no Downtime" -...
Data Natives Amsterdam v 9.0 | "Ten Little Servers: A Story of no Downtime" -...Dataconomy Media
 
Data Natives Amsterdam v 9.0 | "Point in Time Labeling at Scale" - Timothy Th...
Data Natives Amsterdam v 9.0 | "Point in Time Labeling at Scale" - Timothy Th...Data Natives Amsterdam v 9.0 | "Point in Time Labeling at Scale" - Timothy Th...
Data Natives Amsterdam v 9.0 | "Point in Time Labeling at Scale" - Timothy Th...Dataconomy Media
 
Data Natives Hamburg v 6.0 | "Interpersonal behavior: observing Alex to under...
Data Natives Hamburg v 6.0 | "Interpersonal behavior: observing Alex to under...Data Natives Hamburg v 6.0 | "Interpersonal behavior: observing Alex to under...
Data Natives Hamburg v 6.0 | "Interpersonal behavior: observing Alex to under...Dataconomy Media
 
Data Natives Hamburg v 6.0 | "About Surfing, Failing & Scaling" - Florian Sch...
Data Natives Hamburg v 6.0 | "About Surfing, Failing & Scaling" - Florian Sch...Data Natives Hamburg v 6.0 | "About Surfing, Failing & Scaling" - Florian Sch...
Data Natives Hamburg v 6.0 | "About Surfing, Failing & Scaling" - Florian Sch...Dataconomy Media
 
Data NativesBerlin v 20.0 | "Serving A/B experimentation platform end-to-end"...
Data NativesBerlin v 20.0 | "Serving A/B experimentation platform end-to-end"...Data NativesBerlin v 20.0 | "Serving A/B experimentation platform end-to-end"...
Data NativesBerlin v 20.0 | "Serving A/B experimentation platform end-to-end"...Dataconomy Media
 
Data Natives Berlin v 20.0 | "Ten Little Servers: A Story of no Downtime" - A...
Data Natives Berlin v 20.0 | "Ten Little Servers: A Story of no Downtime" - A...Data Natives Berlin v 20.0 | "Ten Little Servers: A Story of no Downtime" - A...
Data Natives Berlin v 20.0 | "Ten Little Servers: A Story of no Downtime" - A...Dataconomy Media
 
Big Data Frankfurt meets Thinkport | "The Cloud as a Driver of Innovation" - ...
Big Data Frankfurt meets Thinkport | "The Cloud as a Driver of Innovation" - ...Big Data Frankfurt meets Thinkport | "The Cloud as a Driver of Innovation" - ...
Big Data Frankfurt meets Thinkport | "The Cloud as a Driver of Innovation" - ...Dataconomy Media
 
Thinkport meets Frankfurt | "Financial Time Series Analysis using Wavelets" -...
Thinkport meets Frankfurt | "Financial Time Series Analysis using Wavelets" -...Thinkport meets Frankfurt | "Financial Time Series Analysis using Wavelets" -...
Thinkport meets Frankfurt | "Financial Time Series Analysis using Wavelets" -...Dataconomy Media
 
Big Data Helsinki v 3 | "Distributed Machine and Deep Learning at Scale with ...
Big Data Helsinki v 3 | "Distributed Machine and Deep Learning at Scale with ...Big Data Helsinki v 3 | "Distributed Machine and Deep Learning at Scale with ...
Big Data Helsinki v 3 | "Distributed Machine and Deep Learning at Scale with ...Dataconomy Media
 
Big Data Helsinki v 3 | "Federated Learning and Privacy-preserving AI" - Oguz...
Big Data Helsinki v 3 | "Federated Learning and Privacy-preserving AI" - Oguz...Big Data Helsinki v 3 | "Federated Learning and Privacy-preserving AI" - Oguz...
Big Data Helsinki v 3 | "Federated Learning and Privacy-preserving AI" - Oguz...Dataconomy Media
 

Más de Dataconomy Media (20)

Data Natives Paris v 10.0 | "Blockchain in Healthcare" - Lea Dias & David An...
Data Natives Paris v 10.0 | "Blockchain in Healthcare" - Lea Dias & 	David An...Data Natives Paris v 10.0 | "Blockchain in Healthcare" - Lea Dias & 	David An...
Data Natives Paris v 10.0 | "Blockchain in Healthcare" - Lea Dias & David An...
 
Data Natives Frankfurt v 11.0 | "Competitive advantages with knowledge graphs...
Data Natives Frankfurt v 11.0 | "Competitive advantages with knowledge graphs...Data Natives Frankfurt v 11.0 | "Competitive advantages with knowledge graphs...
Data Natives Frankfurt v 11.0 | "Competitive advantages with knowledge graphs...
 
Data Natives Frankfurt v 11.0 | "Can we be responsible for misuse of data & a...
Data Natives Frankfurt v 11.0 | "Can we be responsible for misuse of data & a...Data Natives Frankfurt v 11.0 | "Can we be responsible for misuse of data & a...
Data Natives Frankfurt v 11.0 | "Can we be responsible for misuse of data & a...
 
Data Natives Munich v 12.0 | "How to be more productive with Autonomous Data ...
Data Natives Munich v 12.0 | "How to be more productive with Autonomous Data ...Data Natives Munich v 12.0 | "How to be more productive with Autonomous Data ...
Data Natives Munich v 12.0 | "How to be more productive with Autonomous Data ...
 
Data Natives meets DataRobot | "Build and deploy an anti-money laundering mo...
Data Natives meets DataRobot |  "Build and deploy an anti-money laundering mo...Data Natives meets DataRobot |  "Build and deploy an anti-money laundering mo...
Data Natives meets DataRobot | "Build and deploy an anti-money laundering mo...
 
Data Natives Munich v 12.0 | "Political Data Science: A tale of Fake News, So...
Data Natives Munich v 12.0 | "Political Data Science: A tale of Fake News, So...Data Natives Munich v 12.0 | "Political Data Science: A tale of Fake News, So...
Data Natives Munich v 12.0 | "Political Data Science: A tale of Fake News, So...
 
Data Natives Vienna v 7.0 | "Building Kubernetes Operators with KUDO for Dat...
Data Natives Vienna v 7.0  | "Building Kubernetes Operators with KUDO for Dat...Data Natives Vienna v 7.0  | "Building Kubernetes Operators with KUDO for Dat...
Data Natives Vienna v 7.0 | "Building Kubernetes Operators with KUDO for Dat...
 
Data Natives Vienna v 7.0 | "The Ingredients of Data Innovation" - Robbert de...
Data Natives Vienna v 7.0 | "The Ingredients of Data Innovation" - Robbert de...Data Natives Vienna v 7.0 | "The Ingredients of Data Innovation" - Robbert de...
Data Natives Vienna v 7.0 | "The Ingredients of Data Innovation" - Robbert de...
 
Data Natives Cologne v 4.0 | "The Data Lorax: Planting the Seeds of Fairness...
Data Natives Cologne v 4.0  | "The Data Lorax: Planting the Seeds of Fairness...Data Natives Cologne v 4.0  | "The Data Lorax: Planting the Seeds of Fairness...
Data Natives Cologne v 4.0 | "The Data Lorax: Planting the Seeds of Fairness...
 
Data Natives Cologne v 4.0 | "How People Analytics Can Reveal the Hidden Aspe...
Data Natives Cologne v 4.0 | "How People Analytics Can Reveal the Hidden Aspe...Data Natives Cologne v 4.0 | "How People Analytics Can Reveal the Hidden Aspe...
Data Natives Cologne v 4.0 | "How People Analytics Can Reveal the Hidden Aspe...
 
Data Natives Amsterdam v 9.0 | "Ten Little Servers: A Story of no Downtime" -...
Data Natives Amsterdam v 9.0 | "Ten Little Servers: A Story of no Downtime" -...Data Natives Amsterdam v 9.0 | "Ten Little Servers: A Story of no Downtime" -...
Data Natives Amsterdam v 9.0 | "Ten Little Servers: A Story of no Downtime" -...
 
Data Natives Amsterdam v 9.0 | "Point in Time Labeling at Scale" - Timothy Th...
Data Natives Amsterdam v 9.0 | "Point in Time Labeling at Scale" - Timothy Th...Data Natives Amsterdam v 9.0 | "Point in Time Labeling at Scale" - Timothy Th...
Data Natives Amsterdam v 9.0 | "Point in Time Labeling at Scale" - Timothy Th...
 
Data Natives Hamburg v 6.0 | "Interpersonal behavior: observing Alex to under...
Data Natives Hamburg v 6.0 | "Interpersonal behavior: observing Alex to under...Data Natives Hamburg v 6.0 | "Interpersonal behavior: observing Alex to under...
Data Natives Hamburg v 6.0 | "Interpersonal behavior: observing Alex to under...
 
Data Natives Hamburg v 6.0 | "About Surfing, Failing & Scaling" - Florian Sch...
Data Natives Hamburg v 6.0 | "About Surfing, Failing & Scaling" - Florian Sch...Data Natives Hamburg v 6.0 | "About Surfing, Failing & Scaling" - Florian Sch...
Data Natives Hamburg v 6.0 | "About Surfing, Failing & Scaling" - Florian Sch...
 
Data NativesBerlin v 20.0 | "Serving A/B experimentation platform end-to-end"...
Data NativesBerlin v 20.0 | "Serving A/B experimentation platform end-to-end"...Data NativesBerlin v 20.0 | "Serving A/B experimentation platform end-to-end"...
Data NativesBerlin v 20.0 | "Serving A/B experimentation platform end-to-end"...
 
Data Natives Berlin v 20.0 | "Ten Little Servers: A Story of no Downtime" - A...
Data Natives Berlin v 20.0 | "Ten Little Servers: A Story of no Downtime" - A...Data Natives Berlin v 20.0 | "Ten Little Servers: A Story of no Downtime" - A...
Data Natives Berlin v 20.0 | "Ten Little Servers: A Story of no Downtime" - A...
 
Big Data Frankfurt meets Thinkport | "The Cloud as a Driver of Innovation" - ...
Big Data Frankfurt meets Thinkport | "The Cloud as a Driver of Innovation" - ...Big Data Frankfurt meets Thinkport | "The Cloud as a Driver of Innovation" - ...
Big Data Frankfurt meets Thinkport | "The Cloud as a Driver of Innovation" - ...
 
Thinkport meets Frankfurt | "Financial Time Series Analysis using Wavelets" -...
Thinkport meets Frankfurt | "Financial Time Series Analysis using Wavelets" -...Thinkport meets Frankfurt | "Financial Time Series Analysis using Wavelets" -...
Thinkport meets Frankfurt | "Financial Time Series Analysis using Wavelets" -...
 
Big Data Helsinki v 3 | "Distributed Machine and Deep Learning at Scale with ...
Big Data Helsinki v 3 | "Distributed Machine and Deep Learning at Scale with ...Big Data Helsinki v 3 | "Distributed Machine and Deep Learning at Scale with ...
Big Data Helsinki v 3 | "Distributed Machine and Deep Learning at Scale with ...
 
Big Data Helsinki v 3 | "Federated Learning and Privacy-preserving AI" - Oguz...
Big Data Helsinki v 3 | "Federated Learning and Privacy-preserving AI" - Oguz...Big Data Helsinki v 3 | "Federated Learning and Privacy-preserving AI" - Oguz...
Big Data Helsinki v 3 | "Federated Learning and Privacy-preserving AI" - Oguz...
 

Último

Predictive Analysis - Using Insight-informed Data to Plan Inventory in Next 6...
Predictive Analysis - Using Insight-informed Data to Plan Inventory in Next 6...Predictive Analysis - Using Insight-informed Data to Plan Inventory in Next 6...
Predictive Analysis - Using Insight-informed Data to Plan Inventory in Next 6...ThinkInnovation
 
Decision Making Under Uncertainty - Is It Better Off Joining a Partnership or...
Decision Making Under Uncertainty - Is It Better Off Joining a Partnership or...Decision Making Under Uncertainty - Is It Better Off Joining a Partnership or...
Decision Making Under Uncertainty - Is It Better Off Joining a Partnership or...ThinkInnovation
 
Role of Consumer Insights in business transformation
Role of Consumer Insights in business transformationRole of Consumer Insights in business transformation
Role of Consumer Insights in business transformationAnnie Melnic
 
IBEF report on the Insurance market in India
IBEF report on the Insurance market in IndiaIBEF report on the Insurance market in India
IBEF report on the Insurance market in IndiaManalVerma4
 
Data Analysis Project Presentation: Unveiling Your Ideal Customer, Bank Custo...
Data Analysis Project Presentation: Unveiling Your Ideal Customer, Bank Custo...Data Analysis Project Presentation: Unveiling Your Ideal Customer, Bank Custo...
Data Analysis Project Presentation: Unveiling Your Ideal Customer, Bank Custo...Boston Institute of Analytics
 
6 Tips for Interpretable Topic Models _ by Nicha Ruchirawat _ Towards Data Sc...
6 Tips for Interpretable Topic Models _ by Nicha Ruchirawat _ Towards Data Sc...6 Tips for Interpretable Topic Models _ by Nicha Ruchirawat _ Towards Data Sc...
6 Tips for Interpretable Topic Models _ by Nicha Ruchirawat _ Towards Data Sc...Dr Arash Najmaei ( Phd., MBA, BSc)
 
Presentation of project of business person who are success
Presentation of project of business person who are successPresentation of project of business person who are success
Presentation of project of business person who are successPratikSingh115843
 
why-transparency-and-traceability-are-essential-for-sustainable-supply-chains...
why-transparency-and-traceability-are-essential-for-sustainable-supply-chains...why-transparency-and-traceability-are-essential-for-sustainable-supply-chains...
why-transparency-and-traceability-are-essential-for-sustainable-supply-chains...Jack Cole
 
Bank Loan Approval Analysis: A Comprehensive Data Analysis Project
Bank Loan Approval Analysis: A Comprehensive Data Analysis ProjectBank Loan Approval Analysis: A Comprehensive Data Analysis Project
Bank Loan Approval Analysis: A Comprehensive Data Analysis ProjectBoston Institute of Analytics
 
Statistics For Management by Richard I. Levin 8ed.pdf
Statistics For Management by Richard I. Levin 8ed.pdfStatistics For Management by Richard I. Levin 8ed.pdf
Statistics For Management by Richard I. Levin 8ed.pdfnikeshsingh56
 
DATA ANALYSIS using various data sets like shoping data set etc
DATA ANALYSIS using various data sets like shoping data set etcDATA ANALYSIS using various data sets like shoping data set etc
DATA ANALYSIS using various data sets like shoping data set etclalithasri22
 
Decoding Movie Sentiments: Analyzing Reviews with Data Analysis model
Decoding Movie Sentiments: Analyzing Reviews with Data Analysis modelDecoding Movie Sentiments: Analyzing Reviews with Data Analysis model
Decoding Movie Sentiments: Analyzing Reviews with Data Analysis modelBoston Institute of Analytics
 
Digital Indonesia Report 2024 by We Are Social .pdf
Digital Indonesia Report 2024 by We Are Social .pdfDigital Indonesia Report 2024 by We Are Social .pdf
Digital Indonesia Report 2024 by We Are Social .pdfNicoChristianSunaryo
 

Último (16)

Predictive Analysis - Using Insight-informed Data to Plan Inventory in Next 6...
Predictive Analysis - Using Insight-informed Data to Plan Inventory in Next 6...Predictive Analysis - Using Insight-informed Data to Plan Inventory in Next 6...
Predictive Analysis - Using Insight-informed Data to Plan Inventory in Next 6...
 
Data Analysis Project: Stroke Prediction
Data Analysis Project: Stroke PredictionData Analysis Project: Stroke Prediction
Data Analysis Project: Stroke Prediction
 
2023 Survey Shows Dip in High School E-Cigarette Use
2023 Survey Shows Dip in High School E-Cigarette Use2023 Survey Shows Dip in High School E-Cigarette Use
2023 Survey Shows Dip in High School E-Cigarette Use
 
Decision Making Under Uncertainty - Is It Better Off Joining a Partnership or...
Decision Making Under Uncertainty - Is It Better Off Joining a Partnership or...Decision Making Under Uncertainty - Is It Better Off Joining a Partnership or...
Decision Making Under Uncertainty - Is It Better Off Joining a Partnership or...
 
Role of Consumer Insights in business transformation
Role of Consumer Insights in business transformationRole of Consumer Insights in business transformation
Role of Consumer Insights in business transformation
 
IBEF report on the Insurance market in India
IBEF report on the Insurance market in IndiaIBEF report on the Insurance market in India
IBEF report on the Insurance market in India
 
Insurance Churn Prediction Data Analysis Project
Insurance Churn Prediction Data Analysis ProjectInsurance Churn Prediction Data Analysis Project
Insurance Churn Prediction Data Analysis Project
 
Data Analysis Project Presentation: Unveiling Your Ideal Customer, Bank Custo...
Data Analysis Project Presentation: Unveiling Your Ideal Customer, Bank Custo...Data Analysis Project Presentation: Unveiling Your Ideal Customer, Bank Custo...
Data Analysis Project Presentation: Unveiling Your Ideal Customer, Bank Custo...
 
6 Tips for Interpretable Topic Models _ by Nicha Ruchirawat _ Towards Data Sc...
6 Tips for Interpretable Topic Models _ by Nicha Ruchirawat _ Towards Data Sc...6 Tips for Interpretable Topic Models _ by Nicha Ruchirawat _ Towards Data Sc...
6 Tips for Interpretable Topic Models _ by Nicha Ruchirawat _ Towards Data Sc...
 
Presentation of project of business person who are success
Presentation of project of business person who are successPresentation of project of business person who are success
Presentation of project of business person who are success
 
why-transparency-and-traceability-are-essential-for-sustainable-supply-chains...
why-transparency-and-traceability-are-essential-for-sustainable-supply-chains...why-transparency-and-traceability-are-essential-for-sustainable-supply-chains...
why-transparency-and-traceability-are-essential-for-sustainable-supply-chains...
 
Bank Loan Approval Analysis: A Comprehensive Data Analysis Project
Bank Loan Approval Analysis: A Comprehensive Data Analysis ProjectBank Loan Approval Analysis: A Comprehensive Data Analysis Project
Bank Loan Approval Analysis: A Comprehensive Data Analysis Project
 
Statistics For Management by Richard I. Levin 8ed.pdf
Statistics For Management by Richard I. Levin 8ed.pdfStatistics For Management by Richard I. Levin 8ed.pdf
Statistics For Management by Richard I. Levin 8ed.pdf
 
DATA ANALYSIS using various data sets like shoping data set etc
DATA ANALYSIS using various data sets like shoping data set etcDATA ANALYSIS using various data sets like shoping data set etc
DATA ANALYSIS using various data sets like shoping data set etc
 
Decoding Movie Sentiments: Analyzing Reviews with Data Analysis model
Decoding Movie Sentiments: Analyzing Reviews with Data Analysis modelDecoding Movie Sentiments: Analyzing Reviews with Data Analysis model
Decoding Movie Sentiments: Analyzing Reviews with Data Analysis model
 
Digital Indonesia Report 2024 by We Are Social .pdf
Digital Indonesia Report 2024 by We Are Social .pdfDigital Indonesia Report 2024 by We Are Social .pdf
Digital Indonesia Report 2024 by We Are Social .pdf
 

Andrew Clegg, Data Scientician & Machine Learning Engine-Driver: "Deep product recommendations with Keras and TensorFlow"

  • 2. IN A NUTSHELL ABOUT ME • Etsy, Pearson, Last.fm, AstraZeneca, consulting • Academic background: bioinformatics, information retrieval, natural language processing (UCL/Birkbeck) • Main interests: search, recommendations, personalization • @andrew_clegg • http://andrewclegg.org/
  • 3. DEEP PRODUCT RECOMMENDATIONS ABOUT THIS TALK • Framing recommendation tasks in terms of neural networks and deep learning • Some network architectures from the literature • Why use neural methods at all?
  • 5. This is a broad overview, and I’m not a specialist (yet) BEAR WITH ME, I’M A DEEP LEARNING NOOB. ” “
  • 6. COMMON RECOMMENDATION TASKS AND HOW TO FRAME THEM IN DEEP LEARNING TERMS
  • 7. NON-PERSONALIZED, CONTEXT-BASED SIMILAR ITEMS BASED ON CO-OCCURRENCE • “Context” = liked by same user, bought in same order, etc. • Item-based collaborative filtering • Cold-start recommendations for new users • “Related items” / “Buy these items together” • Also useful for nearest-neighbours classification (e.g. tag prediction) • Classically based on item-item matrix factorization
  • 8. NEURAL INTERPRETATION SIMILAR ITEMS BASED ON CO-OCCURRENCE • Items that co-occur should have embeddings that are close in space • Key point: similar goal to word2vec • “Item2Vec: Neural Item Embedding for Collaborative Filtering” • Barkan & Koenigstein (Microsoft) • Train network to differentiate between items that did occur in same context as training item, and items that didn’t occur (skip-gram)
  • 9. SESSION-BASED, ORDER-AWARE PREDICTING NEXT-VIEWED ITEMS • Contextual recommendations based on recent/current activity • Given a user’s session so far, what are they most likely to want next? • Classical methods include: • Markov decision processes • Bayesian scoring with Thompson sampling • Models based on sum or average of events so far (not order-aware)
  • 10. NEURAL INTERPRETATION PREDICTING NEXT-VIEWED ITEMS • Recurrent Neural Networks and their relatives (LSTMs, GRUs etc.) • Key point: similar to sampling from a language model • Session is “sentence”, items are “words”, catalogue is “vocabulary” • “Session-based Recommendations with Recurrent Neural Networks” • Hidasi et al (Gravity R&D / Telefonica Research) — GRU4Rec • “Improved Recurrent Neural Networks for Session-based Recommendations” • Tan et al (A*STAR)
  • 11. PERSONALIZED, HISTORY-BASED BEHAVIOURAL ITEM RECOMMENDATIONS • User-based collaborative filtering • “Users like you also liked…” • Explicit or implicit feedback (likes/ratings vs. viewed/not-viewed) • Typical approach: user-item matrix factorization • Map users and items into same lower-dimensional space • Rating prediction or nearest-neighbour search
  • 12. NEURAL INTERPRETATION BEHAVIOURAL ITEM RECOMMENDATIONS • Learn embeddings for users and items such that: • user · item approximates rating, or… • user · viewed item > user · non-viewed item • Or more generally: • f(user, item) approximates rating, or… • f(user, viewed item) > f(user, non-viewed item) • Key point: easy to replicate factor models, then add more layers
  • 13. NEURAL INTERPRETATION: SIMPLE APPROACH BEHAVIOURAL ITEM RECOMMENDATIONS class CFModel(Sequential): def __init__(self, n_users, m_items, k_factors, **kwargs): P = Sequential() P.add(Embedding(n_users, k_factors, input_length=1)) P.add(Reshape((k_factors,))) Q = Sequential() Q.add(Embedding(m_items, k_factors, input_length=1)) Q.add(Reshape((k_factors,))) super(CFModel, self).__init__(**kwargs) self.add(Merge([P, Q], mode='dot', dot_axes=1)) • github: bradleypallen/keras-movielens-cf based on example from fenris.org blog post: “Collaborative Filtering in Keras” • Deeper version: “Recommending Movies with Deep Learning” • Richard Weiss (blog post)
  • 14. NEURAL INTERPRETATION: TRIPLET LEARNING BEHAVIOURAL ITEM RECOMMENDATIONS def build_model(num_users, num_items, latent_dim): positive_item_input = Input((1, ), name='positive_item_input') negative_item_input = Input((1, ), name='negative_item_input') # Shared embedding layer for positive and negative items item_embedding_layer = Embedding( num_items, latent_dim, name='item_embedding', input_length=1) user_input = Input((1, ), name='user_input') positive_item_embedding = Flatten()(item_embedding_layer(positive_item_input)) negative_item_embedding = Flatten()(item_embedding_layer(negative_item_input)) user_embedding = Flatten()(Embedding( num_users, latent_dim, name='user_embedding', input_length=1)( user_input)) loss = merge( [positive_item_embedding, negative_item_embedding, user_embedding], mode=bpr_triplet_loss, name='loss', output_shape=(1, )) model = Model( input=[positive_item_input, negative_item_input, user_input], output=loss) model.compile(loss=identity_loss, optimizer=Adam()) return model
  • 15. NEURAL INTERPRETATION: TRIPLET LEARNING BEHAVIOURAL ITEM RECOMMENDATIONS def bpr_triplet_loss(X): positive_item_latent, negative_item_latent, user_latent = X # Bayesian Personalized Ranking loss loss = 1.0 - K.sigmoid( K.sum(user_latent * positive_item_latent, axis=-1, keepdims=True) - K.sum(user_latent * negative_item_latent, axis=-1, keepdims=True)) return loss • github: maciejkula/triplet_recommendations_keras • For each (user, item_pos, item_neg) triplet: • Learn to score (user, item_pos) higher than (user, item_neg) • Loss function from “BPR: Bayesian Personalized Ranking from Implicit Feedback” — Rendle et al (Univ. Of Hildesheim)
  • 16. PERSONALIZED, HISTORY & CONTENT-BASED HYBRID RECOMMENDATIONS • Blend of collaborative filtering based on behavioural data, and supervised learning based on features (of item, of user, of context) • State-of-the-art for many recommendation tasks • “Factorization Machines” • Steffen Rendle (Osaka University) — LibFM • “Metadata Embeddings for User and Item Cold-start Recommendations” • Maciej Kula (Lyst) — LightFM
  • 17. NEURAL INTERPRETATION: WIDE & DEEP MODELS HYBRID RECOMMENDATIONS • Deep neural networks can learn to generalize to both similar users and similar items • But shallow, sparse models can learn specific effects easily • So, combine both into one model • “Wide & Deep Learning for Recommender Systems” • Cheng et al (Google) — see also tutorial on TensorFlow website
  • 18. HYBRID RECOMMENDATIONS NEURAL INTERPRETATION: WIDE & DEEP MODELS Image from Wide & Deep Learning tutorial on tensorflow.org
  • 19. NEURAL INTERPRETATION: TWO-STAGE RECOMMENDERS HYBRID RECOMMENDATIONS • Alternative approach — split task into two steps: 1. Classification model to select shortlist of items likely to be clicked 2. Ranking model to determine correct display order for these items • Both steps can use personalized features about the user • Each one is an easier task than attempting to rank entire catalogue • “Deep Neural Networks for YouTube Recommendations” • Covington et al (Google)
  • 20. THE BIGGER PICTURE WHY USE DEEP LEARNING AT ALL?
  • 21. DEEP LEARNING ISN’T AN AUTOMATIC WIN A WORD OF WARNING • Deep learning won’t necessarily beat best classical models! • DL models can be harder to train • They often require a lot more tedious hyperparameter tuning • How many layers? How wide should each be? • What kind of activation function(s)? • How much regularization, and where? • What learning algorithm to use? With what settings? Etc etc etc…
  • 22. WHY SHOULD I CONSIDER DEEP LEARNING? SO WHAT ARE THE ADVANTAGES? • DL models are flexible and highly composable • Easy to use smaller models as components in larger ones, e.g.: • Plug output of LSTM model of session activity into input of deep collaborative filtering model • Plug output of image feature extraction model into input of personalized reranking models • Take weights learnt in one model and use them in another, e.g.: • Embeddings from word2vec in a content-based recommender
  • 23. WHY SHOULD I CONSIDER DEEP LEARNING? SO WHAT ARE THE ADVANTAGES? • DL toolkits keep getting better and better • Take advantage of GPUs (single/multiple/whole cluster…) • Easy to take existing models and slightly extend/modify them • Easy to try new loss functions, network architectures etc. • No need to get bogged down in C code or maths • Models and whole approaches can be transferred between domains • So much example code out there to follow
  • 24. ANY QUESTIONS? THANKS! • Feel free to grab me afterwards to chat about anything • Or ping me on Twitter: • @andrew_clegg • Special thanks to Maciej Kula for his suggestions