PredictionIO / template-scala-parallel-universal-recommendation

PredictiionIO Template for Universal Recommender
111 stars 48 forks source link

Can I take advantage of user "follow" relationships? #38

Closed rbjarnason closed 8 years ago

rbjarnason commented 8 years ago

I have "follower" relationships between the users. Can those be used to improve recommendations? Any hints on how?

pferrel commented 8 years ago

Just about anything you know about users can be used. Certainly "follow"

You need first to determine what your primary indicator is. Think of this as "what do I want the user to do?" For E-com it's "buy a product", for Netflix it's "watch a video", for a newspaper it's "read a story". This will define what items are to be returned in recommendations.

Primary Indicator: (user-id, event-name, item-id) for example (user-id, "buy", product-id)

Then secondary indicators are things that you think will give some indication of user taste. They are of the same form (user-id, indicator-name, item-id) but for secondary indicators the indicator name implies the type of the item-id and the type of item doesn't need to be the same as the primary indicator. So in your case, after creating a primary indicator, one secondary event would be:

Secondary indicator: (user-id, "follows", user-id)

In Engine.json make "eventNames": ["primary-indicator-name","follows"] The first is the primary, all others in the array are secondary.

Look at the readme.md here for instructions about how to format and send the events and if you leave questions on the other root repo you will ge better resonce, this is a forked repo. https://github.com/actionml/template-scala-parallel-universal-recommendation/tree/v0.3.0

rbjarnason commented 8 years ago

Thank you you very much for clear instructions @pferrel :) We are working on a library for citizen participation applications to help recommend interesting posts and ideas. We have in the past week integrated PIO and this template, trained it on 6 years worth of user interaction data and are getting some great recommendation even without the 'follow' that we will now add. https://github.com/rbjarnason/active-citizen

heshamMassoud commented 8 years ago

@rbjarnason I have a question on this. What you're trying to achieve is to improve recommendations by increasing the similarity of users who follow each other, right?

let's say we have two users with ids: user1 and user2. What you are trying to do, is recommend items user2 likes to user1, if user1 follows user2, right?

If yes, then my question is: When you trigger this secondary indicator: (user1, "follows", user2) How does engine know that the id user2 actually corresponds to a user id?

Because normally, this secondary indicators are of the form (user1, "category-prefernce", "horror") or (user1 "view", item1)

pferrel commented 8 years ago

The answer is in the math that you claim not to want to read ;-)

It actually doesn't matter what the second id is because cross-occurrence is a probabilistic correlation testing algorithm. Two items do not need to be of the same type to have user preferences for them correlated.

The only restriction is that the primary/conversion event will define the type of item recommended. All the secondary items of whatever type will be seen in the user's history as an indicator for their taste in the conversion item.

BTW This is really the wrong place for this conversation, it is not the root repo and is better addressed on the group where others will benefit.