SlideShare ist ein Scribd-Unternehmen logo
1 von 23
Downloaden Sie, um offline zu lesen
A quick introduction to item-based
collaborative filtering



                     Pham Cong Dinh
                     @pcdinh
                     PHPDay Saigon 2012
Outline
●   PHP popularity and challenges to produce
    engaging content
●   Recommendation engine at work
●   How to build a item-based collaborative
    filtering-based recommendation engine
PHP is everywhere
●   W3Tech report in 2012
●


●


●
PHP website distribution
●   Reported by builtwith.com in 2012 (more than
    28 millions site in PHP)
●


●


●
You have a website. Now what?
Information overload


                     OR
                 no engaging
                   content?




                  From http://bethesignal.org/
Why recommendation system?
●
Recommendation engine at work
Recommendation engine at work
Build a recommendation system
●   Collaborative filtering: user and item
        –   Filtering: automatic predictions about the interests
              of a user
        –   Collaborative: many users (preferences or taste
             information)
Item-based collaborative filtering
●   Model-based
       –   The similarities between different items in the data
            set are calculated
       –   Predict ratings for user-item pairs not present in
             the data set
Steps to do item-based
          collaborative filtering
●   Data collection and representations (preferences/taste
    …)
●   Finding the relationships and determine the similarity
●   Recommendation computations -
    recommendations/suggestions/discoveries (produce
    engaging content)
Collaborative filtering: data
             collection
●   Data collection and representations
    (preferences/taste …)                     (user, item)
        –   Clicks                        X,1
                                          ✗



        –   Likes, favorites              X,2
                                          ✗



                                          Y,1
            Watch, read
                                          ✗
        –
                                          Y,2
                                          ✗

        –   Survey
                                          Z,2
                                          ✗

        –   Ratings                       Z,3
                                          ✗


        –   Others …
●   E.x: Find the set of movies that user X likes
Collaborative filtering: Similarity
                (1)
●   Finding the relationships and determine the
    similarity
        –   The similarity values between items are
             measured by observing all the users who
             have interacted (rated) both the items
●   E.x: Find a group of movies that is similar to
    these set of movies that we know user X likes
Collaborative filtering: Similarity
                (2)
●       Manhattan distance: |x1 – x2| + |y1 - y2|
●                        X                                           Y


●



                             User(x, y)

                             Amy(5, 5)
    X                        Bill(2, 5)
                             Jim(1, 4)

                             Item(x1, x2, x3) → Ratings
                             Snow Crash(5, 2, 1)
                             Girl with the Dragon Tattoo (5, 5, 1)

                             Manhattan distance
                             → Amy – Bill: |5 – 2| + |5 – 5| = 3
                   Y         → Snow Crash - Girl with the Dragon Tattoo: 3
Collaborative filtering: Similarity
                (3)
●   Cosine distance: the angle between these
    vectors. Value: -1 (no related) to 1




    Item(x1, x2, x3) → Ratings
    Snow Crash(5, 2, 1)
    Girl with the Dragon Tattoo (5, 5, 1)

    Cosine distance
    → Snow Crash - Girl with the Dragon Tattoo:
    (5x5 + 2x5 + 1x1) / (( 5x5 + 2x2 + 1 x 1) x ( 5x5 + 5x5 + 1x1))

    PHP: https://github.com/aoiaoi/CosineSimilarity/blob/master/CosineSimilarity.php
Collaborative filtering: Similarity
                (4)
●   Pearson Correlation Coefficient: from -1 (no
    related) to +1
●


●


●


●


●   How much the ratings by common users for a
    pair of items deviate from average ratings for
    those items
●   Correlation is basically the average product
Collaborative filtering: Similarity
                (5)
●   Euclidean distance: the "ordinary" distance
    between two points.
●


●


●


●


●   Values: Near 0 (no related) to 1
Collaborative filtering: Similarity
                (6)
●   Spearman distance: Spearman distance is a
    square of Euclidean Distance between two
    rank vectors. A perfect positive correlation is
    +1 and a perfect negative correlation is -1.
●


●


●   Spearman Rank Correlation: The range of
    Spearman Correlation is from -1 to 1 (a perfect
    Spearman correlation of +1)
Collaborative filtering: Similarity
                (6)
●   Adjusted Euclidean distance: take length of
    vectors into account
●
Collaborative filtering:
Recommendation computations
●   Calculate similarity between Item A that user X
    watch/buy/like with items that User X does not
    watch/buy/like
●   Score all the items (e.x: apply weighted
    algorithms – average score by the other)
●   Sorting
●   Return top-N items
Collaborative filtering: Other
                issues
●   Accuracy of Predicting Ratings. To evaluate
    accuracy when predicting unrated item for the active
    user, use Mean Absolute Error (MAE).
●   Accuracy of Recommendations. To evaluate the
    accuracy of recommendations, use Mean Average
    Precision (MAP), which is defined as Average of the
    Average Precision (AP) value for a set of queries (a
    query could be considered as a user’s asking for
    recommending items in recommender systems).
The End

●   Q&A

Weitere ähnliche Inhalte

Ähnlich wie Speaker pham cong dinh

Recommender Systems Fairness Evaluation via Generalized Cross Entropy
Recommender Systems Fairness Evaluation via Generalized Cross EntropyRecommender Systems Fairness Evaluation via Generalized Cross Entropy
Recommender Systems Fairness Evaluation via Generalized Cross EntropyVito Walter Anelli
 
Kdd12 tutorial-inf-part-iv
Kdd12 tutorial-inf-part-ivKdd12 tutorial-inf-part-iv
Kdd12 tutorial-inf-part-ivLaks Lakshmanan
 
Recommender Systems: Advances in Collaborative Filtering
Recommender Systems: Advances in Collaborative FilteringRecommender Systems: Advances in Collaborative Filtering
Recommender Systems: Advances in Collaborative FilteringChangsung Moon
 
improving explicit preference entry by visualising data similarities
improving explicit preference entry by visualising data similaritiesimproving explicit preference entry by visualising data similarities
improving explicit preference entry by visualising data similaritiesKris Jack
 
How to build recommender system
How to build recommender systemHow to build recommender system
How to build recommender systemMitko Gurbanski
 
Recommender Systems! @ASAI 2011
Recommender Systems! @ASAI 2011Recommender Systems! @ASAI 2011
Recommender Systems! @ASAI 2011Ernesto Mislej
 
Ingroup favoritism under indirect reciprocity
Ingroup favoritism under indirect reciprocityIngroup favoritism under indirect reciprocity
Ingroup favoritism under indirect reciprocityNaoki Masuda
 
Recruiters, Job Seekers and Spammers: Innovations in Job Search at LinkedIn
Recruiters, Job Seekers and Spammers: Innovations in Job Search at LinkedInRecruiters, Job Seekers and Spammers: Innovations in Job Search at LinkedIn
Recruiters, Job Seekers and Spammers: Innovations in Job Search at LinkedInDaria Sorokina
 
Neo4j MeetUp - Graph Exploration with MetaExp
Neo4j MeetUp - Graph Exploration with MetaExpNeo4j MeetUp - Graph Exploration with MetaExp
Neo4j MeetUp - Graph Exploration with MetaExpAdrian Ziegler
 
Past, present, and future of Recommender Systems: an industry perspective
Past, present, and future of Recommender Systems: an industry perspectivePast, present, and future of Recommender Systems: an industry perspective
Past, present, and future of Recommender Systems: an industry perspectiveXavier Amatriain
 
Movie recommendation project
Movie recommendation projectMovie recommendation project
Movie recommendation projectAbhishek Jaisingh
 
Probabilistic Group Recommendation via Information Matching
Probabilistic Group Recommendation via Information MatchingProbabilistic Group Recommendation via Information Matching
Probabilistic Group Recommendation via Information MatchingJagadeesh Gorla
 
Cooperation and Reputation
Cooperation and ReputationCooperation and Reputation
Cooperation and ReputationVincent Traag
 
Tag And Tag Based Recommender
Tag And Tag Based RecommenderTag And Tag Based Recommender
Tag And Tag Based Recommendergu wendong
 
movierecommendationproject-171223181147.pptx
movierecommendationproject-171223181147.pptxmovierecommendationproject-171223181147.pptx
movierecommendationproject-171223181147.pptxAryanVyawahare
 
A new similarity measurement based on hellinger distance for collaborating fi...
A new similarity measurement based on hellinger distance for collaborating fi...A new similarity measurement based on hellinger distance for collaborating fi...
A new similarity measurement based on hellinger distance for collaborating fi...Prabhu Kumar
 

Ähnlich wie Speaker pham cong dinh (20)

Recommender Systems
Recommender SystemsRecommender Systems
Recommender Systems
 
Recommender Systems Fairness Evaluation via Generalized Cross Entropy
Recommender Systems Fairness Evaluation via Generalized Cross EntropyRecommender Systems Fairness Evaluation via Generalized Cross Entropy
Recommender Systems Fairness Evaluation via Generalized Cross Entropy
 
Kdd12 tutorial-inf-part-iv
Kdd12 tutorial-inf-part-ivKdd12 tutorial-inf-part-iv
Kdd12 tutorial-inf-part-iv
 
Recommender Systems: Advances in Collaborative Filtering
Recommender Systems: Advances in Collaborative FilteringRecommender Systems: Advances in Collaborative Filtering
Recommender Systems: Advances in Collaborative Filtering
 
Raccomender engines
Raccomender enginesRaccomender engines
Raccomender engines
 
improving explicit preference entry by visualising data similarities
improving explicit preference entry by visualising data similaritiesimproving explicit preference entry by visualising data similarities
improving explicit preference entry by visualising data similarities
 
How to build recommender system
How to build recommender systemHow to build recommender system
How to build recommender system
 
Recommender Systems! @ASAI 2011
Recommender Systems! @ASAI 2011Recommender Systems! @ASAI 2011
Recommender Systems! @ASAI 2011
 
Ingroup favoritism under indirect reciprocity
Ingroup favoritism under indirect reciprocityIngroup favoritism under indirect reciprocity
Ingroup favoritism under indirect reciprocity
 
Recruiters, Job Seekers and Spammers: Innovations in Job Search at LinkedIn
Recruiters, Job Seekers and Spammers: Innovations in Job Search at LinkedInRecruiters, Job Seekers and Spammers: Innovations in Job Search at LinkedIn
Recruiters, Job Seekers and Spammers: Innovations in Job Search at LinkedIn
 
Neo4j MeetUp - Graph Exploration with MetaExp
Neo4j MeetUp - Graph Exploration with MetaExpNeo4j MeetUp - Graph Exploration with MetaExp
Neo4j MeetUp - Graph Exploration with MetaExp
 
Past, present, and future of Recommender Systems: an industry perspective
Past, present, and future of Recommender Systems: an industry perspectivePast, present, and future of Recommender Systems: an industry perspective
Past, present, and future of Recommender Systems: an industry perspective
 
Cluster
ClusterCluster
Cluster
 
Movie recommendation project
Movie recommendation projectMovie recommendation project
Movie recommendation project
 
Probabilistic Group Recommendation via Information Matching
Probabilistic Group Recommendation via Information MatchingProbabilistic Group Recommendation via Information Matching
Probabilistic Group Recommendation via Information Matching
 
Cooperation and Reputation
Cooperation and ReputationCooperation and Reputation
Cooperation and Reputation
 
Tag And Tag Based Recommender
Tag And Tag Based RecommenderTag And Tag Based Recommender
Tag And Tag Based Recommender
 
movierecommendationproject-171223181147.pptx
movierecommendationproject-171223181147.pptxmovierecommendationproject-171223181147.pptx
movierecommendationproject-171223181147.pptx
 
A new similarity measurement based on hellinger distance for collaborating fi...
A new similarity measurement based on hellinger distance for collaborating fi...A new similarity measurement based on hellinger distance for collaborating fi...
A new similarity measurement based on hellinger distance for collaborating fi...
 
C3.2.2
C3.2.2C3.2.2
C3.2.2
 

Mehr von AiTi Education

AiTi Education Profile
AiTi Education ProfileAiTi Education Profile
AiTi Education ProfileAiTi Education
 
AiTi Education Software Testing Session 03
AiTi Education Software Testing Session 03AiTi Education Software Testing Session 03
AiTi Education Software Testing Session 03AiTi Education
 
AiTi Education Software Testing Session 02 b
AiTi Education Software Testing Session 02 bAiTi Education Software Testing Session 02 b
AiTi Education Software Testing Session 02 bAiTi Education
 
AiTi Education Software Testing Session 02 a
AiTi Education Software Testing Session 02 aAiTi Education Software Testing Session 02 a
AiTi Education Software Testing Session 02 aAiTi Education
 
AiTi Education Software Testing Session 01 b
AiTi Education Software Testing Session 01 bAiTi Education Software Testing Session 01 b
AiTi Education Software Testing Session 01 bAiTi Education
 
AiTi Education Software Testing Session 01 a
AiTi Education Software Testing Session 01 aAiTi Education Software Testing Session 01 a
AiTi Education Software Testing Session 01 aAiTi Education
 
Vietnam mobile internet_2014_mwork_vietnam_mobile_day
Vietnam mobile internet_2014_mwork_vietnam_mobile_dayVietnam mobile internet_2014_mwork_vietnam_mobile_day
Vietnam mobile internet_2014_mwork_vietnam_mobile_dayAiTi Education
 
[Vietnam Mobile Day 2014] Tăng doanh thu quảng cáo cho mobile site và ứng dụn...
[Vietnam Mobile Day 2014] Tăng doanh thu quảng cáo cho mobile site và ứng dụn...[Vietnam Mobile Day 2014] Tăng doanh thu quảng cáo cho mobile site và ứng dụn...
[Vietnam Mobile Day 2014] Tăng doanh thu quảng cáo cho mobile site và ứng dụn...AiTi Education
 
[Vietnam Mobile Day 2014] Mobile money - Xu hướng thanh toán nhỏ trên mobile ...
[Vietnam Mobile Day 2014] Mobile money - Xu hướng thanh toán nhỏ trên mobile ...[Vietnam Mobile Day 2014] Mobile money - Xu hướng thanh toán nhỏ trên mobile ...
[Vietnam Mobile Day 2014] Mobile money - Xu hướng thanh toán nhỏ trên mobile ...AiTi Education
 
[Vietnam Mobile Day 2014] Mobile kết nối thế giới số và thế giới thực và vai ...
[Vietnam Mobile Day 2014] Mobile kết nối thế giới số và thế giới thực và vai ...[Vietnam Mobile Day 2014] Mobile kết nối thế giới số và thế giới thực và vai ...
[Vietnam Mobile Day 2014] Mobile kết nối thế giới số và thế giới thực và vai ...AiTi Education
 
[Vietnam Mobile Day 2014] The new mobile marketing channel: Social Wifi Marke...
[Vietnam Mobile Day 2014] The new mobile marketing channel: Social Wifi Marke...[Vietnam Mobile Day 2014] The new mobile marketing channel: Social Wifi Marke...
[Vietnam Mobile Day 2014] The new mobile marketing channel: Social Wifi Marke...AiTi Education
 
[Vietnam Mobile Day 2014] Cá nhân hóa và xác định Khách hàng mục tiêu trong q...
[Vietnam Mobile Day 2014] Cá nhân hóa và xác định Khách hàng mục tiêu trong q...[Vietnam Mobile Day 2014] Cá nhân hóa và xác định Khách hàng mục tiêu trong q...
[Vietnam Mobile Day 2014] Cá nhân hóa và xác định Khách hàng mục tiêu trong q...AiTi Education
 
[Vietnam Mobile Day 2014] Chiến lược thu hút người dùng cho ứng dụng tại thị ...
[Vietnam Mobile Day 2014] Chiến lược thu hút người dùng cho ứng dụng tại thị ...[Vietnam Mobile Day 2014] Chiến lược thu hút người dùng cho ứng dụng tại thị ...
[Vietnam Mobile Day 2014] Chiến lược thu hút người dùng cho ứng dụng tại thị ...AiTi Education
 
[Vietnam Mobile Day 2014] Thanh toán mobile, hiện tại và xu hướng- Nguyễn Chi...
[Vietnam Mobile Day 2014] Thanh toán mobile, hiện tại và xu hướng- Nguyễn Chi...[Vietnam Mobile Day 2014] Thanh toán mobile, hiện tại và xu hướng- Nguyễn Chi...
[Vietnam Mobile Day 2014] Thanh toán mobile, hiện tại và xu hướng- Nguyễn Chi...AiTi Education
 
[Vietnam Mobile Day 2014] Thanh toán bằng thẻ ngân hàng trên mobile chưa bao ...
[Vietnam Mobile Day 2014] Thanh toán bằng thẻ ngân hàng trên mobile chưa bao ...[Vietnam Mobile Day 2014] Thanh toán bằng thẻ ngân hàng trên mobile chưa bao ...
[Vietnam Mobile Day 2014] Thanh toán bằng thẻ ngân hàng trên mobile chưa bao ...AiTi Education
 
[Vietnam Mobile Day 2014] How to build a mobile store app in 5 minutes - Ng...
[Vietnam Mobile Day 2014] How to build a mobile store app in 5 minutes - 	 Ng...[Vietnam Mobile Day 2014] How to build a mobile store app in 5 minutes - 	 Ng...
[Vietnam Mobile Day 2014] How to build a mobile store app in 5 minutes - Ng...AiTi Education
 
[Vietnam Mobile Day 2014] Touch the future of the web - Nguyễn Việt Anh - Cou...
[Vietnam Mobile Day 2014] Touch the future of the web - Nguyễn Việt Anh - Cou...[Vietnam Mobile Day 2014] Touch the future of the web - Nguyễn Việt Anh - Cou...
[Vietnam Mobile Day 2014] Touch the future of the web - Nguyễn Việt Anh - Cou...AiTi Education
 
[Vietnam Mobile Day 2014] Xu hướng trong Mobile Learning, 2014 - Nguyễn Thàn...
[Vietnam Mobile Day 2014] Xu hướng trong Mobile Learning, 2014  - Nguyễn Thàn...[Vietnam Mobile Day 2014] Xu hướng trong Mobile Learning, 2014  - Nguyễn Thàn...
[Vietnam Mobile Day 2014] Xu hướng trong Mobile Learning, 2014 - Nguyễn Thàn...AiTi Education
 
[Vietnam Mobile Day 2014] Toàn cảnh thị trường game smartphone Việt Nam 2013....
[Vietnam Mobile Day 2014] Toàn cảnh thị trường game smartphone Việt Nam 2013....[Vietnam Mobile Day 2014] Toàn cảnh thị trường game smartphone Việt Nam 2013....
[Vietnam Mobile Day 2014] Toàn cảnh thị trường game smartphone Việt Nam 2013....AiTi Education
 
[Vietnam Mobile Day 2014] Toàn cảnh thị trường game smartphone Việt Nam 2013....
[Vietnam Mobile Day 2014] Toàn cảnh thị trường game smartphone Việt Nam 2013....[Vietnam Mobile Day 2014] Toàn cảnh thị trường game smartphone Việt Nam 2013....
[Vietnam Mobile Day 2014] Toàn cảnh thị trường game smartphone Việt Nam 2013....AiTi Education
 

Mehr von AiTi Education (20)

AiTi Education Profile
AiTi Education ProfileAiTi Education Profile
AiTi Education Profile
 
AiTi Education Software Testing Session 03
AiTi Education Software Testing Session 03AiTi Education Software Testing Session 03
AiTi Education Software Testing Session 03
 
AiTi Education Software Testing Session 02 b
AiTi Education Software Testing Session 02 bAiTi Education Software Testing Session 02 b
AiTi Education Software Testing Session 02 b
 
AiTi Education Software Testing Session 02 a
AiTi Education Software Testing Session 02 aAiTi Education Software Testing Session 02 a
AiTi Education Software Testing Session 02 a
 
AiTi Education Software Testing Session 01 b
AiTi Education Software Testing Session 01 bAiTi Education Software Testing Session 01 b
AiTi Education Software Testing Session 01 b
 
AiTi Education Software Testing Session 01 a
AiTi Education Software Testing Session 01 aAiTi Education Software Testing Session 01 a
AiTi Education Software Testing Session 01 a
 
Vietnam mobile internet_2014_mwork_vietnam_mobile_day
Vietnam mobile internet_2014_mwork_vietnam_mobile_dayVietnam mobile internet_2014_mwork_vietnam_mobile_day
Vietnam mobile internet_2014_mwork_vietnam_mobile_day
 
[Vietnam Mobile Day 2014] Tăng doanh thu quảng cáo cho mobile site và ứng dụn...
[Vietnam Mobile Day 2014] Tăng doanh thu quảng cáo cho mobile site và ứng dụn...[Vietnam Mobile Day 2014] Tăng doanh thu quảng cáo cho mobile site và ứng dụn...
[Vietnam Mobile Day 2014] Tăng doanh thu quảng cáo cho mobile site và ứng dụn...
 
[Vietnam Mobile Day 2014] Mobile money - Xu hướng thanh toán nhỏ trên mobile ...
[Vietnam Mobile Day 2014] Mobile money - Xu hướng thanh toán nhỏ trên mobile ...[Vietnam Mobile Day 2014] Mobile money - Xu hướng thanh toán nhỏ trên mobile ...
[Vietnam Mobile Day 2014] Mobile money - Xu hướng thanh toán nhỏ trên mobile ...
 
[Vietnam Mobile Day 2014] Mobile kết nối thế giới số và thế giới thực và vai ...
[Vietnam Mobile Day 2014] Mobile kết nối thế giới số và thế giới thực và vai ...[Vietnam Mobile Day 2014] Mobile kết nối thế giới số và thế giới thực và vai ...
[Vietnam Mobile Day 2014] Mobile kết nối thế giới số và thế giới thực và vai ...
 
[Vietnam Mobile Day 2014] The new mobile marketing channel: Social Wifi Marke...
[Vietnam Mobile Day 2014] The new mobile marketing channel: Social Wifi Marke...[Vietnam Mobile Day 2014] The new mobile marketing channel: Social Wifi Marke...
[Vietnam Mobile Day 2014] The new mobile marketing channel: Social Wifi Marke...
 
[Vietnam Mobile Day 2014] Cá nhân hóa và xác định Khách hàng mục tiêu trong q...
[Vietnam Mobile Day 2014] Cá nhân hóa và xác định Khách hàng mục tiêu trong q...[Vietnam Mobile Day 2014] Cá nhân hóa và xác định Khách hàng mục tiêu trong q...
[Vietnam Mobile Day 2014] Cá nhân hóa và xác định Khách hàng mục tiêu trong q...
 
[Vietnam Mobile Day 2014] Chiến lược thu hút người dùng cho ứng dụng tại thị ...
[Vietnam Mobile Day 2014] Chiến lược thu hút người dùng cho ứng dụng tại thị ...[Vietnam Mobile Day 2014] Chiến lược thu hút người dùng cho ứng dụng tại thị ...
[Vietnam Mobile Day 2014] Chiến lược thu hút người dùng cho ứng dụng tại thị ...
 
[Vietnam Mobile Day 2014] Thanh toán mobile, hiện tại và xu hướng- Nguyễn Chi...
[Vietnam Mobile Day 2014] Thanh toán mobile, hiện tại và xu hướng- Nguyễn Chi...[Vietnam Mobile Day 2014] Thanh toán mobile, hiện tại và xu hướng- Nguyễn Chi...
[Vietnam Mobile Day 2014] Thanh toán mobile, hiện tại và xu hướng- Nguyễn Chi...
 
[Vietnam Mobile Day 2014] Thanh toán bằng thẻ ngân hàng trên mobile chưa bao ...
[Vietnam Mobile Day 2014] Thanh toán bằng thẻ ngân hàng trên mobile chưa bao ...[Vietnam Mobile Day 2014] Thanh toán bằng thẻ ngân hàng trên mobile chưa bao ...
[Vietnam Mobile Day 2014] Thanh toán bằng thẻ ngân hàng trên mobile chưa bao ...
 
[Vietnam Mobile Day 2014] How to build a mobile store app in 5 minutes - Ng...
[Vietnam Mobile Day 2014] How to build a mobile store app in 5 minutes - 	 Ng...[Vietnam Mobile Day 2014] How to build a mobile store app in 5 minutes - 	 Ng...
[Vietnam Mobile Day 2014] How to build a mobile store app in 5 minutes - Ng...
 
[Vietnam Mobile Day 2014] Touch the future of the web - Nguyễn Việt Anh - Cou...
[Vietnam Mobile Day 2014] Touch the future of the web - Nguyễn Việt Anh - Cou...[Vietnam Mobile Day 2014] Touch the future of the web - Nguyễn Việt Anh - Cou...
[Vietnam Mobile Day 2014] Touch the future of the web - Nguyễn Việt Anh - Cou...
 
[Vietnam Mobile Day 2014] Xu hướng trong Mobile Learning, 2014 - Nguyễn Thàn...
[Vietnam Mobile Day 2014] Xu hướng trong Mobile Learning, 2014  - Nguyễn Thàn...[Vietnam Mobile Day 2014] Xu hướng trong Mobile Learning, 2014  - Nguyễn Thàn...
[Vietnam Mobile Day 2014] Xu hướng trong Mobile Learning, 2014 - Nguyễn Thàn...
 
[Vietnam Mobile Day 2014] Toàn cảnh thị trường game smartphone Việt Nam 2013....
[Vietnam Mobile Day 2014] Toàn cảnh thị trường game smartphone Việt Nam 2013....[Vietnam Mobile Day 2014] Toàn cảnh thị trường game smartphone Việt Nam 2013....
[Vietnam Mobile Day 2014] Toàn cảnh thị trường game smartphone Việt Nam 2013....
 
[Vietnam Mobile Day 2014] Toàn cảnh thị trường game smartphone Việt Nam 2013....
[Vietnam Mobile Day 2014] Toàn cảnh thị trường game smartphone Việt Nam 2013....[Vietnam Mobile Day 2014] Toàn cảnh thị trường game smartphone Việt Nam 2013....
[Vietnam Mobile Day 2014] Toàn cảnh thị trường game smartphone Việt Nam 2013....
 

Speaker pham cong dinh

  • 1. A quick introduction to item-based collaborative filtering Pham Cong Dinh @pcdinh PHPDay Saigon 2012
  • 2. Outline ● PHP popularity and challenges to produce engaging content ● Recommendation engine at work ● How to build a item-based collaborative filtering-based recommendation engine
  • 3. PHP is everywhere ● W3Tech report in 2012 ● ● ●
  • 4. PHP website distribution ● Reported by builtwith.com in 2012 (more than 28 millions site in PHP) ● ● ●
  • 5. You have a website. Now what?
  • 6. Information overload OR no engaging content? From http://bethesignal.org/
  • 10. Build a recommendation system ● Collaborative filtering: user and item – Filtering: automatic predictions about the interests of a user – Collaborative: many users (preferences or taste information)
  • 11. Item-based collaborative filtering ● Model-based – The similarities between different items in the data set are calculated – Predict ratings for user-item pairs not present in the data set
  • 12. Steps to do item-based collaborative filtering ● Data collection and representations (preferences/taste …) ● Finding the relationships and determine the similarity ● Recommendation computations - recommendations/suggestions/discoveries (produce engaging content)
  • 13. Collaborative filtering: data collection ● Data collection and representations (preferences/taste …) (user, item) – Clicks X,1 ✗ – Likes, favorites X,2 ✗ Y,1 Watch, read ✗ – Y,2 ✗ – Survey Z,2 ✗ – Ratings Z,3 ✗ – Others … ● E.x: Find the set of movies that user X likes
  • 14. Collaborative filtering: Similarity (1) ● Finding the relationships and determine the similarity – The similarity values between items are measured by observing all the users who have interacted (rated) both the items ● E.x: Find a group of movies that is similar to these set of movies that we know user X likes
  • 15. Collaborative filtering: Similarity (2) ● Manhattan distance: |x1 – x2| + |y1 - y2| ● X Y ● User(x, y) Amy(5, 5) X Bill(2, 5) Jim(1, 4) Item(x1, x2, x3) → Ratings Snow Crash(5, 2, 1) Girl with the Dragon Tattoo (5, 5, 1) Manhattan distance → Amy – Bill: |5 – 2| + |5 – 5| = 3 Y → Snow Crash - Girl with the Dragon Tattoo: 3
  • 16. Collaborative filtering: Similarity (3) ● Cosine distance: the angle between these vectors. Value: -1 (no related) to 1 Item(x1, x2, x3) → Ratings Snow Crash(5, 2, 1) Girl with the Dragon Tattoo (5, 5, 1) Cosine distance → Snow Crash - Girl with the Dragon Tattoo: (5x5 + 2x5 + 1x1) / (( 5x5 + 2x2 + 1 x 1) x ( 5x5 + 5x5 + 1x1)) PHP: https://github.com/aoiaoi/CosineSimilarity/blob/master/CosineSimilarity.php
  • 17. Collaborative filtering: Similarity (4) ● Pearson Correlation Coefficient: from -1 (no related) to +1 ● ● ● ● ● How much the ratings by common users for a pair of items deviate from average ratings for those items ● Correlation is basically the average product
  • 18. Collaborative filtering: Similarity (5) ● Euclidean distance: the "ordinary" distance between two points. ● ● ● ● ● Values: Near 0 (no related) to 1
  • 19. Collaborative filtering: Similarity (6) ● Spearman distance: Spearman distance is a square of Euclidean Distance between two rank vectors. A perfect positive correlation is +1 and a perfect negative correlation is -1. ● ● ● Spearman Rank Correlation: The range of Spearman Correlation is from -1 to 1 (a perfect Spearman correlation of +1)
  • 20. Collaborative filtering: Similarity (6) ● Adjusted Euclidean distance: take length of vectors into account ●
  • 21. Collaborative filtering: Recommendation computations ● Calculate similarity between Item A that user X watch/buy/like with items that User X does not watch/buy/like ● Score all the items (e.x: apply weighted algorithms – average score by the other) ● Sorting ● Return top-N items
  • 22. Collaborative filtering: Other issues ● Accuracy of Predicting Ratings. To evaluate accuracy when predicting unrated item for the active user, use Mean Absolute Error (MAE). ● Accuracy of Recommendations. To evaluate the accuracy of recommendations, use Mean Average Precision (MAP), which is defined as Average of the Average Precision (AP) value for a set of queries (a query could be considered as a user’s asking for recommending items in recommender systems).
  • 23. The End ● Q&A