37
Recommendation System

Recommendation System - Cleveland State Universitycis.csuohio.edu/~sschung/CIS660/CIS660Lecture...The recommendation system is a system for processing information, which can recommend

  • Upload
    others

  • View
    10

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Recommendation System - Cleveland State Universitycis.csuohio.edu/~sschung/CIS660/CIS660Lecture...The recommendation system is a system for processing information, which can recommend

Recommendation System

Page 2: Recommendation System - Cleveland State Universitycis.csuohio.edu/~sschung/CIS660/CIS660Lecture...The recommendation system is a system for processing information, which can recommend

This image cannot currently be displayed.

Introduction

Data Preprocessing

Building Model and Evaluation

Summary

Outlines

Page 3: Recommendation System - Cleveland State Universitycis.csuohio.edu/~sschung/CIS660/CIS660Lecture...The recommendation system is a system for processing information, which can recommend

Introduction

Page 4: Recommendation System - Cleveland State Universitycis.csuohio.edu/~sschung/CIS660/CIS660Lecture...The recommendation system is a system for processing information, which can recommend

What is recommendation system?

If you love online

shopping, you

might think of

this website.

Page 5: Recommendation System - Cleveland State Universitycis.csuohio.edu/~sschung/CIS660/CIS660Lecture...The recommendation system is a system for processing information, which can recommend

What is recommendation system?

If you love music,

you might think

of this website.

If you love to use

social media, you

might think of

Facebook or

Twitter.

Page 6: Recommendation System - Cleveland State Universitycis.csuohio.edu/~sschung/CIS660/CIS660Lecture...The recommendation system is a system for processing information, which can recommend

The recommendation system is a system for processing information, which can recommend items that meet the requirements

for the user through certain algorithms based on the user's historical behavior data or item data. It is used to recommend

personalized news, videos, music, books, food, clothes and other items to users. In addition, it is used to recommend friends

to users in the social network such as Twitter and Facebook. The recommendation system has become an indispensable part

of many websites and mobile apps. These apps and websites rely on referral systems to increase sales, engage users, increase

user activity and attract new users.

What is recommendation system?

Page 7: Recommendation System - Cleveland State Universitycis.csuohio.edu/~sschung/CIS660/CIS660Lecture...The recommendation system is a system for processing information, which can recommend

• Objective 1: Assist users to find the items they need.

• Objective 2: Filter the information from networks.

• Objective 3: Attract users.

• Objective 4. Provide personalized services.

What is the purpose of recommendation system?

Page 8: Recommendation System - Cleveland State Universitycis.csuohio.edu/~sschung/CIS660/CIS660Lecture...The recommendation system is a system for processing information, which can recommend

Recommendation algorithm

age

gender

Job

attribute

feature

Recommendation

list

item1

Item2

algorithm

item

user

What is algorithm? We

can simplify it as a

function. The function

accepts parameters

and outputs a return

value. The input

parameters have

various attributes and

characteristics of the

user and item,

including age, gender,

territory, category of

the product, release

time, and so on. After

processing by the

recommended

algorithm, it returns a

list of items sorted

according to user

preference.

Page 9: Recommendation System - Cleveland State Universitycis.csuohio.edu/~sschung/CIS660/CIS660Lecture...The recommendation system is a system for processing information, which can recommend

• Content-based recommendation

• Collaborative filtering recommendation

user-based CF

item-based CF

model-based CF

• matrix decomposition

• Factorization Machine

• Deep learning

• Learning to rank

• Explore and exploit(Contextual bandit)

• Ensemble/Hybrid method

Popular recommendation algorithm

Page 10: Recommendation System - Cleveland State Universitycis.csuohio.edu/~sschung/CIS660/CIS660Lecture...The recommendation system is a system for processing information, which can recommend

Content-based recommendation

If a person likes beer with sour taste, the system finds other beers with all the similar flavors and recommend it to him.

Content-based recommendations seem to be the easiest implementation that is the pretty effective. However, it is difficult to get the attributes of an item in most cases. Finding two similar products based on the attributes for recommendation is not an easy task.

Page 11: Recommendation System - Cleveland State Universitycis.csuohio.edu/~sschung/CIS660/CIS660Lecture...The recommendation system is a system for processing information, which can recommend

Collaborative filtering recommendation(user-based)

Collaborative Filtering (CF) is a very commonalgorithm that are used in online stores. TheCF algorithm includes the user-based CF andthe item-based CF.

The user-based CF:• Analyze the current user’s rating of the item• Calculate the similarity between all user's• Select the N users that are most similar to

the current user• Recommend items that the current user has

not browsed from the N users with thehighest rating

Page 12: Recommendation System - Cleveland State Universitycis.csuohio.edu/~sschung/CIS660/CIS660Lecture...The recommendation system is a system for processing information, which can recommend

Collaborative filtering recommendation(item-based)

The item-based CF:• Analyze each user’sbrowsing history of theitem

• Analyze he similaritybetween all items that arebrowsed

• Find N items with thehighest similarity to thecurrent item

• Recommend these N itemsto the user

Page 13: Recommendation System - Cleveland State Universitycis.csuohio.edu/~sschung/CIS660/CIS660Lecture...The recommendation system is a system for processing information, which can recommend

matrix decomposition

There are four users ABCD and four productsWXYZ. We know some of the users’ preference forthe products which is shown in the Rating Matrix.The preference of A for X is 4.5. What is thepreference of A for W?We find two other matrices, the User Matrix andthe Item Matrix, to decompose the Rating Matrix.The number of rows of User Matrix and RatingMatrix must be the same. The number of columnsof Items Matrix and Rating Matrix must be thesame.We need to make the multiplication of User Matrixand Item Matrix is closer to the Rating Matrix. Ifthis can be done, the product matrix contains thepredicted values, which is the basic idea of matrixdecomposition.Matrix decomposition only takes advantage of thevalue of the user’s preference. The user’s attributessuch as gender and age and attributes of theproducts are not considered.

Page 14: Recommendation System - Cleveland State Universitycis.csuohio.edu/~sschung/CIS660/CIS660Lecture...The recommendation system is a system for processing information, which can recommend

Factorization Machine

Factorization Machines (FM) is a user response prediction system that models the relevance between different entities. Each user-item interaction is then encoded into several possible matrix components. The user’s preference for the item is transferred into a formula.For example, there are three users (Tom, Jack, and Alice) and three items (movies, books, and music). It contains User Index, Item Index, User Features, and Item Features.We want to use the values of X to produce a value of Y by calculation.FM is very different from matrix decomposition. There is a product between X. For example, Tom’s X value is multiplied by Tom's age and gender. Tom’s value is also multiplied by the item’s attributes. Gender or age is also multiplied by the item, and then cross-multiplied to get our variables.

Page 15: Recommendation System - Cleveland State Universitycis.csuohio.edu/~sschung/CIS660/CIS660Lecture...The recommendation system is a system for processing information, which can recommend

Deep learning

The deeper learning is used for developrecommendation model

• Input user ID• Add an embedded layer• Connect the outputs of two vectors

of the embedded layer• Add a fully connected layer• Add regularization• Add a fully connected layer again• Add regularization again• Add two fully connect the layers

again• Use SOFTMAX as the prediction

User embedding Item embedding

concatenate

dense

Batch normalization

dense

dense

softmax

dense

Batch normalizationdropout

dropout

predication

Page 16: Recommendation System - Cleveland State Universitycis.csuohio.edu/~sschung/CIS660/CIS660Lecture...The recommendation system is a system for processing information, which can recommend

Deep learning—Google Play App Recommendation

This is Google Play recommendations by machine learning. The inputs are the user’s gender, age, how many apps the user has installed. The information is sent directly to the first embedded layer. The user’s device information and the user’s rating of the apps are added to the second embedding layer, which is linked to the first embedding layer. The product of the installed APP and the user’s rating is used as the final input to a neural network.

Page 17: Recommendation System - Cleveland State Universitycis.csuohio.edu/~sschung/CIS660/CIS660Lecture...The recommendation system is a system for processing information, which can recommend

Learning to rankIf you enter a phrase into a search engine, it will feed back a lot of pages. The articles in the first page is generated by the recommendation system. These are the articles that the system thinks users would like.

This kind of recommendation is the process of sorting a bunch of items to a user when they are presented. The items that the user likes are not important, and the important ones are items that the user prefers.

If you collect user data and user-scoring data, you can use traditional search engine methods to score each item and then sort it. This is a very traditional but useful way.

Page 18: Recommendation System - Cleveland State Universitycis.csuohio.edu/~sschung/CIS660/CIS660Lecture...The recommendation system is a system for processing information, which can recommend

Explore and exploit(Contextual bandit)

Explore and exploit sends random recommendations to users and get feedback from the users.

For example: There are 5 users with similar tastes. Give user1 and user2 two movies and see how they react to the movie.Recommend one for the first user and another for the second user. We found that the first user did not click on the movie and did not watch the movie, but the second user saw it and said that the movie is more interesting than the first movie.

Then we know that the movie recommended for the second user is good, so we can recommend other users to the movies that the second user clicked.

Page 19: Recommendation System - Cleveland State Universitycis.csuohio.edu/~sschung/CIS660/CIS660Lecture...The recommendation system is a system for processing information, which can recommend

Ensemble/Hybrid method

• Voting

mode

average

weighted average

• Stacking

• Boosting

We have a lot of different recommendation algorithms. How do we combine these algorithm outputs?The first way is to vote. Suppose there are three recommendation systems, two of which think that one user likes the item 5 and only one thinks it is 4, then I definitely believe the two. Or taking the average, but I think the first algorithm is better, and giving it a greater weight.The second way to integrate learning is to stack. Suppose there are two kinds of recommendation algorithms. I use the result of the output of the first algorithm as part of the input or input of the second algorithm, and then train the second algorithm.The third one is promotion. We use the deviation between the output value of a recommendation algorithm and the real value to train the algorithm.

Page 20: Recommendation System - Cleveland State Universitycis.csuohio.edu/~sschung/CIS660/CIS660Lecture...The recommendation system is a system for processing information, which can recommend

Data Preprocessing

Page 21: Recommendation System - Cleveland State Universitycis.csuohio.edu/~sschung/CIS660/CIS660Lecture...The recommendation system is a system for processing information, which can recommend

Data preprocessing

Our topic is on

the real estate

recommendation

system

Page 22: Recommendation System - Cleveland State Universitycis.csuohio.edu/~sschung/CIS660/CIS660Lecture...The recommendation system is a system for processing information, which can recommend

Data preprocessing

These are the features that are selected for data preprocessing.

Page 23: Recommendation System - Cleveland State Universitycis.csuohio.edu/~sschung/CIS660/CIS660Lecture...The recommendation system is a system for processing information, which can recommend

Data preprocessing

Page 24: Recommendation System - Cleveland State Universitycis.csuohio.edu/~sschung/CIS660/CIS660Lecture...The recommendation system is a system for processing information, which can recommend

Data preprocessing

Page 25: Recommendation System - Cleveland State Universitycis.csuohio.edu/~sschung/CIS660/CIS660Lecture...The recommendation system is a system for processing information, which can recommend

Building Model and Evaluation

Page 26: Recommendation System - Cleveland State Universitycis.csuohio.edu/~sschung/CIS660/CIS660Lecture...The recommendation system is a system for processing information, which can recommend

Building Model and Evaluation

Cosine similarity is used to compute the distance between every two items.

• Cosine similarity

Page 27: Recommendation System - Cleveland State Universitycis.csuohio.edu/~sschung/CIS660/CIS660Lecture...The recommendation system is a system for processing information, which can recommend

Building Model and Evaluation

Page 28: Recommendation System - Cleveland State Universitycis.csuohio.edu/~sschung/CIS660/CIS660Lecture...The recommendation system is a system for processing information, which can recommend

Building Model and Evaluation

• Query result

propertyId SALES_AMOU ROAD_TYPE WATER SEWER GAS ELECTRICIT GCERT1 GCERT2 RES_BLDG_C TOTAL_RES_ TOTAL_COM_ TOTAL_SQUA SiteCat1 CosineSimilarity Rank

365050 100000 PV MUN SNS Y Y 13800 65700 1 1000 0 4800 Residential 1 1

20779 100000 PV MUN SNS Y Y 17700 63400 1 1272 0 6160 Residential 0.988613 2

441901 100000 PV MUN SNS Y Y 20200 74800 1 1218 0 3666 Residential 0.987431 3

459853 100000 PV MUN SNS Y Y 20100 73800 1 1142 0 8700 Residential 0.987326 4

125822 100000 PV MUN SNS Y Y 18600 71300 1 1004 0 9000 Residential 0.986077 5

94193 100000 PV MUN SNS Y Y 10400 45600 1 1012 0 6050 Residential 0.986013 6

188855 100000 PV MUN SNS Y Y 19800 75200 1 1015 0 8000 Residential 0.979358 7

324880 100000 PV MUN SNS Y Y 22400 100700 1 1025 0 8905 Residential 0.975274 8

467036 100000 PV MUN SNS Y Y 12500 62600 1 1036 0 6084 Residential 0.968359 9

221323 100000 PV MUN SNS Y Y 21000 64000 1 1053 0 5850 Residential 0.962505 10

Page 29: Recommendation System - Cleveland State Universitycis.csuohio.edu/~sschung/CIS660/CIS660Lecture...The recommendation system is a system for processing information, which can recommend

Building Model and Evaluation• KNN + TopN

• The selection of k value

• Cross validation

• Distance measurement

• Euclidean Distance

• Manhattan Distance

• Minkowski Distance

• Classification decision rules

Page 30: Recommendation System - Cleveland State Universitycis.csuohio.edu/~sschung/CIS660/CIS660Lecture...The recommendation system is a system for processing information, which can recommend

Building Model and Evaluation

• Brute Force • KD Tree • Ball Tree

Page 31: Recommendation System - Cleveland State Universitycis.csuohio.edu/~sschung/CIS660/CIS660Lecture...The recommendation system is a system for processing information, which can recommend

Building Model and Evaluation

• Build model

Page 32: Recommendation System - Cleveland State Universitycis.csuohio.edu/~sschung/CIS660/CIS660Lecture...The recommendation system is a system for processing information, which can recommend

Building Model and Evaluation

• Build model

Page 33: Recommendation System - Cleveland State Universitycis.csuohio.edu/~sschung/CIS660/CIS660Lecture...The recommendation system is a system for processing information, which can recommend

Building Model and Evaluation

• Query result

propertyId SALES_AMOU ROAD_TYPE WATER SEWER GAS ELECTRICIT GCERT1 GCERT2 RES_BLDG_C TOTAL_RES_ TOTAL_COM_ TOTAL_SQUA SiteCat1 KNN Rank

322514 100000 PV MUN SNS Y Y 17800 61100 0 0 4166 10000 Commercial 1

443947 100000 PV MUN SNS Y Y 28400 78000 0 0 4210 15960 Commercial 2

87649 100000 PV MUN SNS Y Y 28500 126900 0 0 3600 9600 Commercial 3

180196 100000 PV MUN SNS Y Y 39500 57700 0 0 3106 10720 Commercial 4

227020 100000 PV MUN SNS Y Y 46500 232500 0 0 15410 17606 Commercial 5

67009 100000 PV MUN SNS Y Y 47500 55500 0 0 5002 7681 Commercial 6

330648 100000 PV MUN SNS Y Y 81700 144400 0 0 2068 22956 Commercial 7

282361 100000 PV MUN SNS Y Y 90800 53200 0 0 1492 15125 Commercial 8

503091 100000 PV MUN SNS Y Y 49400 60100 0 0 986 7520 Commercial 9

414418 100000 PV MUN SNS Y Y 53700 100800 0 0 9955 20111 Commercial 10

Page 34: Recommendation System - Cleveland State Universitycis.csuohio.edu/~sschung/CIS660/CIS660Lecture...The recommendation system is a system for processing information, which can recommend

Summary

Page 35: Recommendation System - Cleveland State Universitycis.csuohio.edu/~sschung/CIS660/CIS660Lecture...The recommendation system is a system for processing information, which can recommend

Use PCA to select features that have high weight in the future.Import user data and rating data to build better recommendation system in the future.Include more recommendation algorithm and voting to improve the results.

Summary

Build a website implement this algorithm.

Page 36: Recommendation System - Cleveland State Universitycis.csuohio.edu/~sschung/CIS660/CIS660Lecture...The recommendation system is a system for processing information, which can recommend

Thanksthis is a sample text. insert your desired text here. Again. this is a dummy text. enter your own text

here. this is a sample text. insert your desired text here. Again. this is a dummy text. enter your own text here

Page 37: Recommendation System - Cleveland State Universitycis.csuohio.edu/~sschung/CIS660/CIS660Lecture...The recommendation system is a system for processing information, which can recommend

This image cannot currently be displayed.