You are on page 1of 85

RECOMMENDER SYSTEM

Building Recommender System in


Industries
Content

1. Background:
Definition, Problem Construction and Possible Solutions.

2. SVD-like for Recommender System:


Matrix Factorization to model matrix completion problem

3. Implicit and Explicit signal:


How to model Explicit and Implicit Signal with SVD-like RecSys

4. Recommender System workflow:


Estimate, Filtering, Ranking and Randomization

5. Recommender System Cases


Background:
Recommender System in Industries
Background
● Chris Anderson in “The Long Tail
○ “We are leaving the age of information and entering the age of recommendation”
● CNN Money, “The race to create a 'smart' Google”:
○ “The Web, they say, is leaving the era of search and entering one of discovery.
What's the difference? Search is what you do when you're looking for something.
Discovery is when something wonderful that you didn't know existed, or didn't
know how to ask for, finds you.”

Source: compiled from Xavier Amatriain MLSS slides (2014)


Background
Background
Background
● Value of Recommendation
○ Netflix: 2/3 of the movies watched are recommended
○ Google News: recommendations generate 38% more click through
○ Amazon: 35% sales from recommendations
● Metrics which Affected by Recommendation
○ Activity Metrics: Increase in user retention
○ Financial Metrics: Increase in sales
○ Product Activity: Increase on number of unique items bought

Source: compiled from Xavier Amatriain MLSS slides (2014)


Background
● The “Recommender problem”
○ Estimate a utility function that automatically predicts how a user will like an item.
○ Based on:
■ Past behavior
■ Relations to other users
■ Item similarity
■ Context

Source: compiled from Xavier Amatriain MLSS slides (2014)


Background
The “Recommender problem”

● Let C be set of all users and let S be set of all possible recommendable items
● Let u be a utility function measuring the usefulness of item s to user c, i.e., u : C X S→R,
where R is a totally ordered set
● For each user c є C, we want to choose items s є S that maximize u.

Utility is usually represented by rating but can be any function

Source: compiled from Xavier Amatriain MLSS slides (2014)


Background
Possible Solutions

Source: compiled from Xavier Amatriain MLSS slides (2014)


Background
Problems in Recommendation System: Long Tail Sales
Background
Problems in Recommendation System

● Some users never use some items


SVD-like for Recommender System:
Matrix Factorization to model RecSys
Non-Personalized Recommendation
SVD-like Recommendation
Before dwelling to SVD-like RecSys CF, let’s focus on other approach:

1. Non-Personalized Recommendation
a. For example, Content based filtering, recommend similar items. Product name
embedding with Word2Vec
SVD-like Recommendation
Before dwelling to SVD-like RecSys CF, let’s focus on other approach:

1. Non-Personalized Recommendation
SVD-like Recommendation
Before dwelling to SVD-like RecSys CF, let’s focus on other approach:

1. Non-Personalized Recommendation
a. Recommend items based on similarity:
SVD-like Recommendation
Before dwelling to SVD-like RecSys CF, let’s focus on other approach:

1. Non-Personalized Recommendation
a. Pros:
i. Can be used if you don’t have any transaction history in the beginning
ii. Sometimes can beat popular items benchmark.
b. Cons:
i. Low diversity metrics
1. Buy (mie-ayam), next recommendation (mie-ayam)
SVD-like Recommendation
Before dwelling to SVD-like RecSys CF, let’s focus on other approach:

1. Non-Personalized Recommendation
SVD-like Recommendation
Before dwelling to SVD-like RecSys CF, let’s focus on other approach:

1. Non-Personalized Recommendation

arg max similarity(item1, item2)


Personalized Recommendation
SVD-like Recommendation
Before dwelling to SVD-like RecSys CF, let’s focus on other approach:

2. Personalized Recommendation

arg max Probability(item, user)


SVD-like Recommendation
Before dwelling to SVD-like RecSys CF, let’s focus on other approach:

1. Personalized Recommendation
a. Based on items, users, and items-users interaction

Alex Smola slides form Berkley ML


class (2012)
SVD-like Recommendation
How to model matrix completion:

● Matrix Factorization

Alex Smola slides form Berkley ML


class (2012)
SVD-like Recommendation
Matrix Factorization

● Latent Variable

Alex Smola slides form Berkley ML


class (2012)
SVD-like Recommendation
Matrix Factorization

● Unfortunately we can’t user Matrix Factorization for sparse data

Alex Smola slides form Berkley ML


class (2012)
Funk SVD

Alex Smola slides form Berkley ML


class (2012)
Funk SVD

Source: compiled from Alex Lin slides,


CF with MF (2011)
SVD++

Source: compiled from Alex Lin slides,


CF with MF (2011)
SVD++

Source: compiled from Alex Lin slides,


CF with MF (2011)
SVD++

Source: compiled from Alex Lin slides,


CF with MF (2011)
SVD++

Source: compiled from Alex Lin slides,


CF with MF (2011)
Modeling Implicit and Explicit
Feedback
Explicit and Implicit Feedback
Two types of Feedback

Source: compiled from Li Yen Kuo


slides, Implicit RecSys (2019)
Explicit and Implicit Feedback
In rating systems, such as MovieLens and Allmusic, the value of an entry denotes the rating of
the item given by the user. Ratings can explicitly reflect the preference of an individual.

Source: compiled from Li Yen Kuo


slides, Implicit RecSys (2019)
Explicit and Implicit Feedback
For instance, in a music podcast service, the value of an entry may denote the subscription.

Source: compiled from Li Yen Kuo


slides, Implicit RecSys (2019)
Explicit and Implicit Feedback
Or play count

Source: compiled from Li Yen Kuo


slides, Implicit RecSys (2019)
Source: compiled from Li Yen Kuo
slides, Implicit RecSys (2019)
Explicit and Implicit Feedback
SVD-like model is so easy to fit any feedback type

1. Explicit
a. Rating (Netflix Competition)

Change the loss function to RMSE, regression task.

Source: compiled from Li Yen Kuo


slides, Implicit RecSys (2019)
Explicit and Implicit Feedback
SVD-like model is so easy to fit any feedback type

1. Explicit
b. Like/Dislike (Netflix Now)

Change the loss function to log-loss, sigmoid activation.


Explicit and Implicit Feedback
SVD-like model is so easy to fit any feedback type

2. Implicit
a. Read/Not Read (Quora)

Change loss function to BPR Loss


Explicit and Implicit Feedback
SVD-like model is so easy to fit any feedback type

2. Implicit
b. Frequency of Buy (Retail)

Change loss function to Regression loss with Alpha, Koren (2009)


Recommender System workflow:
Estimate, Ranking and Randomization
Recommender System Workflow

Source: compiled from Xavier


Amatriain MLSS slides (2014)
Recommender System Workflow
Modeling

1. Build Recommender System based on Watch/Not


a. Implicit model, maximize click through rate
2. Build Recommender System based on Rating
a. Explicit model, maximize preference
3. Build Recommender System based on Churn
a. Implicit model, maximize retention

Source: compiled from Xavier


Amatriain MLSS slides (2014)
Recommender System Workflow
Ranking
● Most recommendations are presented in a sorted list
● Recommendation can be understood as a ranking problem
● Popularity is the obvious baseline
● Ratings prediction is a clear secondary data input that allows for personalization
● Many other features can be added
Recommender System Workflow
Ranking

Source: compiled from Xavier


Amatriain MLSS slides (2014)
Randomization

Randomization
● We will focus on Diversity Metrics vs Accuracy Metrics.
● More diverse recommendation will increase Netflix CTR
● More accurate recommendation will increase Netflix CTR
● Diversity and Accuracy are negatively correlated.
Randomization
Recommender System Cases
Questions Pair: Similarity Task
Questions Pair: Similarity Task

Question 1

{0, 1}

Question 2
Questions Pair: Similarity Task

● Is Item A similar to Item B?


Questions Pair: Similarity Task

Input 1

Neural Networks {0, 1}

Input 2
Temporal Recommendation Task
Temporal Recommendation Task

Item 1
Item 2
Item 4
Item 1
Item 2
Item 5

RNN

Item 1
Item 2
Item 3
Recommendation Task
Recommendation Task

Hotel 33
Hotel 77
Click .
data .
.
Hotel 44
Searching Task

Pseudo code BPR

For K times:

1. A = Sample random label positive


2. B = Sample random label negative
3. Dist = Model predict distance(A,B)
4. Update, make the distance farther.

60
Searching Task

Loss Function:

61
Searching Task

● Pointwise
○ for each items, train a classifier / regressor on it to predict how relevant it is
● Pairwise
○ given a pair of documents, compare which one has the highest rank.
● Listwise
○ sort the entire list of documents
■ Direct optimization of IR measures such as NDCG
Searching Task:

63
Matching Task

Cowok Cewek
1 A

Cowok Cewek
2 B

Cowok Cewek
3 C

Cowok Cewek
4 D
Matching Task

Cewek C Cowok 4
Cewek D Cowok 2
Cowok Cewek
1 Cewek A Cowok 1 A
Cewek B Cowok 3
Matching Task

Cewek 1

{0, 1}

Cowok 2

66
Matching Task

Loss Function:

67
Matching Task

Matching Algorithm:

Gale-Shapley

68
Matching Task

cowok cewek

cowok cewek

cowok cewek

cowok cewek
Matching Task

70
You can learn all of these in
our Advance ML CLass

Contact:
business@pacmannai.com
We believe everyone can build cool
Recommendation Systems

Contact:
business@pacmannai.com
Upcoming Advance ML CLass

Contact:
business@pacmannai.com
Check our website:
www.pacmann.ai

Contact:
business@pacmannai.com
Check our website:
www.pacmann.ai

Contact:
business@pacmannai.com
Check our website:
www.pacmann.ai

Contact:
business@pacmannai.com
Past Classes

Contact:
business@pacmannai.com
Pacmann AI Classes

6 Classes in the past

400++ alumni

> 50 institutions

Quality

Theoretical Understanding

Practical Skills

State of the Art of Machine


Learning Research
https://pacmann.ai business@pacmannai.com
Previous Classes

61
participants

48
institutions

8 weeks

https://pacmann.ai business@pacmannai.com
Previous Classes

59
participants

48
institutions

8 weeks

https://pacmann.ai business@pacmannai.com
Previous Classes

44
participants

33
institutions

2 weeks

https://pacmann.ai business@pacmannai.com
Previous Classes
Facts & Figure Field of Work

https://pacmann.ai business@pacmannai.com
Previous Participants

https://pacmann.ai business@pacmannai.com
Contact
Email:
business@pacmannai.com

Whatsapp Business:
+62 812-8122-1707

You might also like