Upload
joy-bennett
View
216
Download
0
Embed Size (px)
Citation preview
2
Table of contents
1. Facebook basics
1.1 Facebook components
1.2 Facebook page
1.3 Facebook group
1.4 Facebook app
2. Social Network Analysis
2.1 MOPSI-Facebook Network – a case study
2.2 Improving MOPSI’s recommendation using Facebook user data.
2.3 Advertising via MOPSI using Social Network Analysis
4
1.1 Facebook components
1. Users
2. Pages
3. Groups
4. Apps
5. Events
User
Joins Event
App
Use
s
Group
Joins
Page Likes
Home
5
1.2 Facebook page
Source: https://www.facebook.com/help/www/174987089221178
- People who like your Page and their friends can get updates in News Feed.
- Content of a page is public (visible to all).
- If a user wants to create a Page to represent a business, he must be an official representative of it.
Home
6
1.3 Facebook group
- It is similar to forum/ discussion board.
- It is different from Page because it can have three privacy options: Open, Closed and Secret.
Source: https://www.facebook.com/help/162866443847527
Home
7
1.4 Facebook app
1. Hosted on Facebook
2. Allows third party applications (e.g. MOPSI) to access FB data
Display Name
Namespace
Facebook app URL
Home
8
MOPSI-FB app: App Id and Secret
MOPSI-FB app URL
- App Id is unique for each app
- App Id and secret are used in Login Dialog generation.
- Login Dialog helps in access token generation.
9
Introduction: Access Token & Permission
Access token: It is a string that uniquely identifies a user and used by app to access his data. Each has certain permissions.
e.g. CAABtc4NJzc1D35FKIENvjdnvreG…
Permissions: These are specified at the time of Login Dialog generation.
e.g. user_friends, user_photos, email etc.
FacebookGraphAPI
MOPSI
CAABtc4NJzc1D…
User’s FB Data (email)
(JSON Format) CAABtc4NJzc1D…
User’s Access Token
Permissions: email
10
Access Token generation
User gets a Login Dialog.
User authenticates and approves permissions
Access token is returned to client.
Access Token generation workflow
The token is then saved in MOPSI database
User requests accessto MOPSI using
Graph API generates Login Dialog.
MOPSI Facebook app
MOPSI server
App idFacebook Graph API
App secret
Request* send to
generate Login Dialog
* Request includes app id, app secret and permissions.
App id e.g. 123568456App secret e.g. 236659
Permissions: email, user_photos, user_friends.
11
Access Token expiration
Access token expires in 3 conditions:
- The lifetime (60 days) of access token is over.
- The user changes the Facebook password.
- The user de-authorizes our app.
Note: If we modify the permissions in the application to get additional data, we need the updated access token.
12
Web solution for expired tokens
When a user presses ‘f’ button to publish photo/route and if access token is expired,a pop up comes and ask user to connect MOPSI account with Facebook.
14
Permissions for Access Token
Categories of permissions:
(a) User Data Permissions (UDP)
(b) Friends Data Permissions (FDP)
(c) Extended Permissions (EP)
19
Comparing permissions with othersPermission MOPSI-FB Tripadvisor Foursquare
Basic informationEmailBirthdayUser’s profile infoPhotosStatus updatesFriend’s profile infoPhoto updates shared with userStatus updates shared with userPost on your behalfTotal
YesYesNoYesYesNoNoNoNoYes5
YesYesNoYesYesYesYesYesYesYes9
YesYesYesYesYesYesNoYesYesYes9
Note: Profile info includes: Educational history, Likes, Hometown and Location
Back -> User similarity slide
21
MOPSI-FB features
- Registration
- Authentication
- Publish photo on Facebook
- Publish route on Facebook
- MOPSI-FB Network
24
Login dialog asking User’s permissions
Popup generated by Facebook. If user presses button “Okay”,Facebook allows MOPSI to read user data
28
Authentication
Sign in with Facebook button allows user to log in to MOPSI using Facebook credentials.
29
Connect with Facebook workflow
If user is logged in
Facebook?
YESUse Facebook SDK to pop up a login to Facebook window
NO
Is login to Facebook
successful?
NO
YES
Facebook SDK displays error message in popup window
Creates MOPSI username, password and send these by email. Save user details in MOPSI db.
Is user’s Facebook id &
email available in MOPSI db?NO
Updates Facebook name, access token andfacebook friends.
YES
Redirect to MOPSI webpage (in case of web)Start MOPSI application (in case of mobile)
User presses Sign in/ Sign up with Facebook button
30
Publish photo on Facebook
Welcome screen of MOPSI mobile application
Camera optionto capture photo
Settings screen
Tick checkboxto share photoson Facebook.
31
MOPSI user’s photo on MOPSI
Mopsi user’s photo on
Map in MOPSI
Location of photo taken
Publish to Facebook option
Description of photo
32
MOPSI user’s photo on FacebookDescription Location taken automatically
by MOPSIThis link redirects to MOPSI which allows us to see photo on Map.
33
MOPSI Photo album on Facebook
User’s profile picture
Photo Album links to Mopsi
Sample picturesof latest additions
34
Photo publishing workflowUser presses ‘F’ button to publish
photo
Get user’s access token from MOPSI database
Is access token valid?
YES NOGet user’s Facebook
album id from database
Is album id valid?
YES
If total photos
in album < 200?
YES
Add new photo in current album.
NO
NO
Create new photo album in Facebook. Save album id in
database
Add new photo in newly created album.
Access Token expiration handling
38
Route publishing workflowUser presses ‘F’ button to publish
route
Get user’s access token from MOPSI database
Is access token valid?
YES NOGet all location points
of user w.r.t. timeAccess Token
expiration handling
Calculate bounds, start & end point and
distance
Get route summary: start & end route address,
duration, mode, speed, distance, date etc.
Create route image by providing route points and bound values to OSM or Google API.
Add route photo on server. Call Facebook Graph API to
publish route on user’s Facebook wall.
Home
40
2.1 MOPSI-FB Network – a case study
MOPSI- FB Network is depicted using solid lines between MOPSI-FB users and their FB friends.
Home
41
Introduction
MOPSI has two types of users:- MOPSI users: who register directly on MOPSI.- MOPSI-FB users: who register on MOPSI via FB.
The third type of users are:- Facebook users: who are Facebook friends of
MOPSI-FB users.
Note: MOPSI users can become MOPSI-FB by pressing Connect to
Facebook button available in profile page on MOPSI.
42
Friendship links
There are two types of Friendship links:
Direct link (link between a MOPSI-FB user and his FB friend)
Friend-Friend link (link between two FB friends of a MOPSI-FB user)
- In this example, ‘Chaitanya’ is a MOPSI-FB user. Others are his FB friends.
- Link between Chaitanya & Andrei isa Direct link.
- Link between Andrei & Radu is aFriend-Friend link.
43
Friendship network extraction
Facebook allows us fetching friends who are up to 1 degree of separation.
Example –
Chaitanya is a MOPSI-FB User
- Green nodes (1 degree away)
can be fetched.
- White nodes (2 degrees away)
can’t be fetched.
C is friend of Andrei
A is friend of Mikko
B is friend of Radu
44
Basic network operations
1. Layout – It deals with the arrangement of nodes while graph is rendering.
2. Average degree – It is the average number of neighbours of all nodes.
3. Betweenness Centrality – It measures how often node appears on shortest paths between nodes in the network.
4. Modularity – It determines modules or communities in which nodes are densely connected internally.
5. Giant component – It is the largest connected component in the graph.
6. Ego network – It is the network of an ego or actor node which consists of it’s direct connections with other nodes.
46
Operation 1 – Layout
ForceAtlas 2 Layout
ForceAtlas2 is a layout algorithm whichallows to manipulate the graph whileit is rendering.
Scaling: 30.0
Scaling is the amount of repulsion we want between nodes in the graph. Moremakes a more sparse graph.
This algorithm is good enough to deal with very small graphs (10 nodes) to mid-size graphs (10, 000 nodes). It can even dealwith bigger graphs, but consumes more time.
47
Operation 2 – Average Degree
Chaitanya Khurana
Average Degree: 3.314
Size of node varies according to node degree.
Min Size: 20Max Size: 80
The average degree of a network is computed over the degree of all nodes, i.e. the average number of neighbours of nodes.
48
Operation 3 – Modularity
Modularity or Community Structure is a Community detection algorithm. Community: The nodes of the network can be easily grouped into sets of nodes such that each set of nodes is densely connected internally.
Algorithm used: Vincent D Blondel, Jean-Loup Guillaume, Renaud Lambiotte, Etienne Lefebvre, Fast unfolding of communities in large networks, in Journal of Statistical Mechanics: Theory and Experiment 2008 (10), P1000
49
Modularity (Communities - 7)
Green - College Friends/ Teachers
Pink – Friends whom I don’t know
or never seen outside Facebook
Blue – Friends of Finland/ UEF
Yellow - Friends of school
Red - Friends of Political Party
Different colour - My relatives
Purple – Neighbours
50
Observation
A new community is formed if any change
in:- Work place (includes school, office etc.)- Place of living
Challenge: Exactly determine communities.
Could be useful:- To measure user similarity of users in same
community versus different community.- To find communities of all susceptible members. Does users having susceptible
members in different communities tend to be more influential than in same.
- Users who have high degree than less degree within community.
51
Operation 4 – Ego Network
Ego Network - Ego networks consist of a focal node ("ego") and the nodes to whom ego is directly connected to (these are called "alters") plus the ties, if any, among the alters.
Alters
52
Example of Ego Network
Node ID: 1373260832 (Gurvinder Singh) – Focal node
Depth: 1
Applying operationof Ego Network
Complete GraphEgo Network of Focal node:Gurvinder Singh
53
Example continues..
Node ID: 1373260832 (Gurvinder Singh)
Depth: 1
Connected to one of my college friend in
green.
At Depth 2, he is connected to everyone.
55
Operation 1 – Layout (ForceAtlas 2)
Each node represents a “user”
Mopsi userin centre
Facebook friends ofMopsi user
Mopsi user with no Facebook friend
MOPSI-FB users: 178Facebook users: 4792Friendship links: 7651
56
Nikola ManojlovicFB Friends: 715
Alexandra JakovljevićFB Friends: 282
AleksiFB Friends: 54
Jesika MatysikFB Friends: 79
Iulian MariusFB Friends: 82
Chandan ShahiFB Friends: 302
Monika ScheffernFB Friends: 153
Pasi FräntiFB Friends: 68 Oili Kohonen
FB Friends: 275
ChaitanyaFB Friends: 534
Sami PietinenFB Friends: 88
Radu FB Friends: 239
TerezaFB Friends: 26
KarolFB:363
MariolaFB:151
AdamFB Friends: 110
KeytiannyFB Friends: 42
ZhentianFB Friends: 94
Ding LiaoFB Friends: 124
Hao Chen FB Friends: 141
Mopsi users
FB usersOperation 2 Degree (1.595)
57
Operation 3 – Betweenness Centrality (Brokers)
It measures how often node appears on shortest paths between nodes in the network.
C has highest Betweenness centrality : 4
B & D have betweenness centrality 3
A & E has 0 betweenness since there is no shortest path which passes from A and E.
58
Chaitanya
Radu Mariescu- Istodor
Nikola Manojlovic
Chandan ShahiVlad Manea
Oili Kohonen
Karol
Operation 3 – Betweenness Centrality (Brokers)
HighMediumLow
(Betweenness Centrality)
Network Diameter: 5Number of shortest paths: 6,412,170
Betweenness Centrality
HighChaitanya: 1,110,163Radu: 940,253MediumKarol: 707,895Chandan Shahi: 606,999
Oili Kohonen: 546,566Vlad Manea: 586,404
Nikola Manojlovic: 456,603
59
Operation 4 – Modularity (Communities) Different colour represents differentcommunities.
Total Communities: 131Mopsi user (Nikola) with his Facebook friendscomes under one community.It is the biggestCommunity with715 friends.
This Mopsi user has zeroFacebook friend. So, he is theonly member in his community.It is one of the smallest communitiesin the graph.
61
Pasi Franti
Oili Kohonen
Chandan ShahiVlad Manea
Chaitanya
Karol
Radu Mariescu-Istodor
Sami Pietinen
Hao Chen Ding Liao
Zhentian Wan
Operation 5 – Giant ComponentNodes: 2286 (47.78%)Edges: 5012 (67.8%)
62
Operation 6 – Ego Network (of any node in the network)
Node ID: 13 (Pasi Franti) – Focal NodeDepth: 1Connected to 69 nodes i.e. 1.44% of total nodes
Pasi Franti
63
Operation 6 – Ego Network (of any node in the network)
Node ID: 13 (Pasi Franti) – Focal NodeDepth: 2Connected to 609 nodes i.e. 12.73% of total nodes
Pasi Franti
64
Operation 6 – Ego Network (of any node in the network)
Node ID: 13 (Pasi Franti) – Focal NodeDepth: 3Connected to 2004 nodes i.e. 41.89% of total nodes
Note: Even at 3 degrees of separation,Pasi node (having lower BetweennessCentrality ) could not reach the value of Giant component (47.78%)
But, when I compared with Radu node(having highest Betweenness centrality)it could reach the value of Giant component(47.78%)
Home
66
Introduction
Facebook user data includes: Profile information of user
Likes, comments and tags on photos and status updates.
GenderBirthday (age)FriendsCheckinsRelationship statusPhotos
LocationEducational historyStatus updateWork historyLikesEmail
67
Data accessible by MOPSI FB app
User data (if public)
Likes and comments made by a user and his friends on user’s photo. Photo tags by user’s friend.
User’s friend data
Gender
GenderFriendsPhotosEmailLikes
Work historyEducational historyRelationship statusLocation
68
User Similarity
Users & their friends’ information could be useful for user similarity. These include:
- hometown & current city
- work history
- likes & comments on user’s photos
- locations of photo taken
- checkins (With Latitude and Longitude)
- likes & comments on wall posts
Green shows information retrieval possible with current permissions. For others, we need additional FB permissions.
Permissions (general) used by other companies.
69
User Similarity – Likes & Comments on photos
Karol Yuliya- In this example, we consider 5 users in the set of MOPSI-FB users and 1 Facebook photo.
Goal: Find Similar users.
Result: Karol and Yuliya are similar users.
This is basic example. In reality, we have thousnadsof photos and hundreds of MOPSI-FB users.
Open questions:- Can we say all these (Radu, Karol & Yuliya) are similar? Radu- uploaded. Others – Likes.- Can we say Karol, Yuliya and Andrei are similarbecause they took action on photo.
Zhentian
Set of MOPSI-FB users
Radu Andrei
70
User Similarity – Location of photo (outside MOPSI)
- Location of photo tells user has been to the specific place.
- Similarity of users may also consider the previous visited places of all users. See next slide.
71
Simple example – Previous photo locations
Tallinn, Estonia (3)Lappeenranta, Finland (1)Petrozavodsk (2)Düsseldorf, Germany (2)Aachen, Germany (3)Vaals (NL) (1)Kelmis,Belgien (1)Joensuu (4)
Joensuu (11)Region Stavanger (1)Bergen, Norway (1)Itlay Venice (1)
Kuopio, Finland (15)Kitee (10)
Colegiul National (1)Madame Tussauds London (1)Tour Eiffel (1)Brussels, Belgium (1)Amsterdam, Netherlands (1)Frankfurt am Main (2)Freiburg, Germany (1)Geneva, Switzerland (1)Monaco (1)Nice, France (1)Genova, Italy (1)Colosseo (3)Maria Theresia Wien (1)
Tallinn, Estonia (1)Joensuu (24)
Karol YuliyaZhentian Radu Andrei
72
Scoring and similarity
U = {U1 , U2 , U3 …….Un }; It is the set of MOPSI-FB users.
L = {L1 , L2 , L3 ………Ln }; It is the set of all photo locations of a
MOPSI-FB user.
)( #
)( #),( 1
11 Lphotos
LphotosLUScore
Equation 1:
} ), ( ),, ( min{ w.r.t.) , ( 1211121 LUScoreLUScoreLUUscoreSimilarity Equation 2:
Source: M.J. Lee, C.W. Chung, “A User Similarity Calculation Based on the Location for Social Network Services”, in DASFAA 2011, Part I, LNCS 6587, pp. 38–52, 2011
where #: Total
73
Similarity score example
For example, Location: Tallinn, Estonia
Score (Karol, Tallinn) = 3/17 = 0.176
Score (Andrei, Tallinn) = 1/25 = 0.04
Similarity score (Karol, Andrei) w.r.t. Tallinn =
min (0.176, 0.04) = 0.04
These can be calculated for all locations to find resultant
similarity score.
74
User Similarity – Check-ins
Facebook Check-in
- Check-ins are in general more specific than location of photo as we saw inprevious example. In this example, Bukhara is an Indian restaurant in Cape Town.
- Rest of procedure for finding user similarity is same as previous example.
- The only hindrance is we need to add one permission of ‘user_status’
Home
75
User Similarity – Page Likes
ZhentianChaitanya
category: Movie, name: December Boys
category: Author, name: Chetan Bhagat
(and so on..)
Total = 148
category: Travel/leisure,name: Norwegian.com/fi
category: Local business, name: Zakka
(and so on..)
Total = 9
List of Similar Pages
category: Universityname: University of Eastern Finland
category: Attractions/Things to doname: Mopsi
And so on..
Total similar pages = 4
Similarity Score = min (4/148, 4/9)= (0.027, 0.44)= 0.027
) U
U ,
U
U (min
2
12
1
12
PagesTotal
PagesSimilar
PagesTotal
PagesSimilarScoreSimilarity
76
User Profile - Categories of Pages
Chaitanya
Pages I likecategory: Movie = 11 (7.43 %) category: Author = 2 (1.35 %)category: Politician = 7 (4.72%)And so on..
These figures convincingly ask to recommend:
Cinema Halls than Book shops and Music storesin the results of Points of Interest.
Categories like:
Movies, TV shows can be clustered in Movies.Book and Author can be clustered in Book.Musician/Band, Music can be clustered in Music.
77
User Similarity - Categories of Pages
Chaitanya
Andrei
Total Pages Andrei Like = 148category: Author = 2/148=0.13category: Book = 0/148=0
Total Pages Andrei Like = 203category: Author = 0/203 = 0category: Book = 11/203 = 0.054
Similarity score (Chaitanya, Andrei) in Book Store = min (0.13,0.054)= 0.054
Similarity score for Music Store, Restaurant etc can be computed keeping Services in mind.
Also, people who like pages of books more indicate that they love Reading and may be ready to lend books on demand.
79
Introduction
1. The advertising idea for MOPSI makes use of
analysis of MOPSI-FB network.
2. It involves analyzing data sharing to determine relationship strength.
3. This could be useful to identify Influential users.
4. These users may help us in promoting products.
80
Motivation
1. New Advertising Model which makes use of Social Network Analysis.
2. Revenue generation for MOPSI
3. MOPSI users (connected via MOPSI) will get discounts
4. MOPSI will become more popular and get more
users.
81
Stakeholders involved
2. Partner Companies e.g. Restaurants, Clubs, Stores etc..
1. MOPSI application
Ex: ABC Restaurant
3. MOPSI-FB users
82
Working (MOPSI users)
Pasi
Influential MOPSI-FB user
Pasi visited ABC restaurant
- Pasi took photo and uploaded on FB- Got 10% discount
Photo contains:Product, Company’s &MOPSI logo
83
Working (Company)
-Wants to promote Pizza-Asks MOPSI about Influential users
MOPSI-Facebook app finds:1. Influential users2. Their Susceptible friends Pasi
Influential user
Pasi’s Suscetible Friendson Facebook
MOPSI Business Interface
(explained on next slide)
85
Influence & Susceptibility
Influence – capacity to have an effect on the behaviour of someone.
Susceptibility – likely to be influenced by other.
This picture was uploaded on Twitter byBarack Obama (Influential Twitter user).As a result, it became viral on it.
Influential user: Barack ObamaSusceptible users: All who re-tweeted.
86
Influence: Social search
)),(Re
),(Re..(
),(
),( ),(
2
12
2
1221
XX
XUtweets
UUtweetsge
XUInvests
UUInvestsUUInfluence
Influence (U1, U2) is defined as proportion of U2’s investment on U1. Invests (U2, U1) is the investment U2 makes on U1. Reference
User U1 User U2
Influence
Invests
X
XUInfluenceUInfluence ),()( 11
Influence of user is defined as the sum of the influences the user has on others.
Source: All Friends are not equal: Using Weights in Social Graph to Improve Search
87
Purpose: Strongest path
31
3
4
5 1
22
11
1
13
1
1 1
3
4
5
1
21
1
3
1
1
1
2
Edge = Invest (Retweets)
11
1
A (Start)
B
C
DE
F
G
H (Target)Strongest Path: (A,D,F,H) = 2.0 * d
3B
C
D
A
I(A,D) =3/6 =0.5 I(A,B) =4/10=0.4
I(A,C)=0.33
I(B,H)=0
H
I(C,H)=0.25
I(D,F) = 0.75
F
I(D,F) = 0.75
88
Algorithm
1. Each edge gets some weight.2. Select start node and target node 3. Find shortest path using Djikstra’s algo.4. Calculate Influence of each edge.5. Calculate Strength S(P) of all paths.6. S(P) = Π (D*Influence (ei)), ei belongs to P. 7. Path with highest strength is strongest path.
D (decay or discount factor) = 0.95 (found experimentally)
Reference: S. Hangal, D. MacLean, M.S. Lam, J. Heer. All Friends are not equal – Using Weights in Social Graphs to Improve Search. SNA - KDD Workshop 2010, Washington D.C, USA.
Web link: http://xenon.stanford.edu/~hangal/socialsearch/
89
Influence: Comparing users
Value of c is determined based on this reference: C. Wittman (2011). Comments 4x More Valuable Than Likes. Available: http://edgerankchecker.com/blog/2011/11/comments-4x-more-valuable-than-likes/. Last accessed 7th Jan 2013.
Edge Influence (U1, U2) is defined as U2’s investment (likes and comments) on total photos of U1.
User U1 User U2
Influence
likes & comments
X
XUInfluenceEdgeUInfluenceNode ),( )( 11
)(U
))(**)(U(),(
1
12 2
21 k
UCncLUUInfluenceEdge ktoi
iii
where:k– total photosLi – likes (0 or 1)c – value is 4ni – number of commentsCi – comments (0 or1)
90
Purpose: Influential users
Influence value
Low High
1 21
Edge Influence:24 3
Node Influence: 4
11
Node Influence: 9
Node Influence: 8
1
1
11
34
1
Node Influence is calculated usingSum of Edge Influences.
91
Comparing Influence Equations
40 10
25 30
Total Photos = 100N.I (A)=(40/95)+(10/25)
= 0.8210N.I (A)=(40/100)+(10/100)
= 0.5
45
Total photos = 80N.I (B)=(40/70)+(15/95)
= 0.729N.I (B)=(40/80)+(15/80)
= 0.687540 15
3515 30
N.I (A) is Node Influence . In this, influence = ),(
),(
2
12
X
XUInvests
UUInvests
N.I (B) is Node Influence. In this, influence =)&(/)(U
))(**)(U(
1
12 2
CLTotalValk
UCncLktoi
iii
A B
Likes
92
Disadvantages
1. Assume each node has equal, fixed resources to invest.
2. It requires global view of the data.
93
Value of ‘c’
- EdgeRank Checker examined a random sampling of 5,500+
Facebook Pages.
- They analyzed 80,000+ of their posts over the month of
October (2011).
- These posts were all of the “Link” type, to keep Clicks more
accurately represented in our data.
Result:
Average clicks per Like: 3.103
Average clicks per Comment: 14.678
Value of 1 Comment = Value of 4 Likes.
94
Determining Susceptibility
),( ),( 2112 UUInfluenceEdgeUUlitySusceptibi
Susceptibility of a user (U2) with respect to other user (U1) is determined as follows:
Similarity based on Influence.Pasi ’s Susceptible users: Andrei, Zhao etc.Radu ‘s Susceptible users: Andrei, Karol etc.
95
Comparison with existing solution
Proposed advertising model
• Publish photo of product on Facebook if a user buys and gets immediate discount.
Advantage
- Company does not give any discount for just visiting.
Foursquare’s advertising model
• Publish checkin on Facebook even if you don’t buy anything.
Disadvantages
- User will get points, badges and can even become Mayor even without buying anything
.
- Company has to give discount even to such Mayors.
96
Comparison with existing solution
Proposed advertising model• Uses Social Network Analysis to
find Influential members.
• Photo will contain product, company’s and MOPSI logo.
Foursquare’s advertising model
• No such initiative is done
• Check in just tells about the place. No information about product.
Home