Recomendation system: Community Detection Based Recomendation System using Hypergraphs
Community detection in Social
(for Recommendation System)
Why community detection?
• People who have similar interests tend to
buy similar products.
• Using community detection techniques,
collective behavior of users is predictable.
• Clustering Web clients who have similar
interests may improve the performance of
• Helpful to mitigate cold start problem.
What is a community?
• A community is a collection of users that are
more closely related to each other than the
rest of the network.
• The relation between users can be amount of
interaction, similar interest,geographical
• Here we find communities of the users having
Cold start problem
• When a user is new to a system,not enough
data is available about the user’s preferences,
he/she has not yet rated enough number of
As a result, the recommendation system
cannot recommend any items to such a user.
• If a user is new in one system, but has a history in
another system, we can use his/her external
proﬁle to recommend relevant items, in the new
system, to this user.
• As an example, consider a new user in youtube,
of whom we are aware of his/her proﬁle in Face-
book. A comprehensive proﬁle of the user can be
produced by the movies he/she posted, liked or
commented on in Face- book and this proﬁle can
be used to recommend relevant movies in
youtube to the same user.
Modeling of the social network
• This particular type of social network is a two
mode affiliation network.
• Affiliation networks are two mode,but have
only one set of actors.The second mode in an
affiliation network is a set of events.
• Such networks cannot be efficiently
represented as simple graphs.
• So we use hypergraphs.
• They are like simple graphs, except that instead of
having edges that only connect 2 vertices, their
edges are sets of any number of vertices. This
happens to mean that all graphs are just a subset of
• Here hyperedge e1 has 3 vertices v1, v2, and v3, E2
has v2 and v3, E3 has v3, v5 and v6, E4 has v4
Why not ordinary graphs?
• Hypergraphs facilitate proper representation
of all kinds of objects involved in a social
network and high order relationships between
• The users of the social networks are modeled
as vertices and edges represent the
relationship between them.
• With hypergraphs more information can be
incurred from the network.
• Data Extraction from facebook.
• Forming hypergraph.
• Local community detection algorithm.
• Making recommendations
Finding local maximal degree nodes
• Modularity:- Modularity is deﬁned as the actual edge weights in the cluster minus
the expected edge weights in the cluster as if the edges are randomly placed
between vertices with an expected probability.
• Input: A social network G = (V, E)
• Output: A communities set C
• Step 1. Find the local maximal degree nodes in G, put the local maximal degree nodes in set H.
• Step 2. For each node hi in H, using Algorithm 2 to discover a local community Ci. put all the
identified local communities into the set C.
• Step 3. If the identified local communities do not cover the whole network, remove C from G. Let H
be empty set and go back to Step 1.
• Step 4. If the identified local communities cover the whole network, merge the communities with
high similarity in C.
• Step 5. Return C as the communities set of network.
• Input: A social network G and a local maximal degree node hi.
• Output: A local community Ci for hi
• Step 1. Put hi in Ci,
• Step 2. Add to Ci the neighbor node vi of hi that results in the largest increase in modularity and has
the greatest common neighbors with hi,
• Step 3. Add to Ci the neighbor node vi of Ci that results in the largest increase in modularity,
• Step 4. Repeat Step 3 until there are no nodes left that increase modularity when the node was
added to the communities.
• Once the communities are available next step
is to make recommendations of the items that
the may like .
Ways to recommend
Types of recommendation systems-
• Content based filtering- based on a description of the
item and a profile of the user’s preference.Eg bayesian
classification.Uses Direct feedback from a user, usually
in the form of a like or dislike button.
• Collaborative filtering-collecting and analyzing a large
amount of information on users’ behaviors, activities
or preferences and predicting what users will like based
on their similarity to other users.
• Hybrid recommendation systems
• Collaborative filtering-They are based on
usage or preference patterns of other users.
• - People who agreed in the past will probably
Here we have used community detection as a
collaborative filtering technique.
• Cosine similarity
• Predicted vote for “active user” a is
To give best recommendtion-Content
• For example we want to recommend movies
for a user whose profile is ready with us.He
has like 3 movies wolverine,serendipity and
• Now we need to find which movie out of the
three (xmen,hulk or avengers) will the user
like the most.
• This is done using naive bayes classifier.
Naive bayes Classifier
• Naive Bayes classification is a machine-
learning technique that can be used to predict
to which category a particular data case
• Bayes theorem:
P(C|X) = P(X|C)·P(C) / P(X)
X is the tuple to be tested.
C is the class.