23
Steffen Staab [email protected] 1 WeST Web Science & Technologies University of Koblenz ▪ Landau, Germany Network Theory and Dynamic Systems Link Prediction Steffen Staab Christoph Ringelstein Acknowledgment: Jérôme Kunegis

Steffen Staab 1WeST Web Science Technologies University of Koblenz ▪ Landau, Germany Network Theory and Dynamic Systems Link Prediction

Embed Size (px)

DESCRIPTION

Steffen Staab 3WeST Social Network PersonFriendship

Citation preview

Page 1: Steffen Staab 1WeST Web Science  Technologies University of Koblenz ▪ Landau, Germany Network Theory and Dynamic Systems Link Prediction

Steffen [email protected]

1WeST

Web Science & TechnologiesUniversity of Koblenz ▪ Landau, Germany

Network Theory and Dynamic SystemsLink Prediction

Steffen StaabChristoph Ringelstein

Acknowledgment: Jérôme Kunegis

Page 2: Steffen Staab 1WeST Web Science  Technologies University of Koblenz ▪ Landau, Germany Network Theory and Dynamic Systems Link Prediction

Steffen [email protected]

2WeST 2

The Problem: Link Prediction

Motivation: Recommend connections in a social network Predict links in an undirected, unweighted network

Known links (A) Links to be predicted (B)

Page 3: Steffen Staab 1WeST Web Science  Technologies University of Koblenz ▪ Landau, Germany Network Theory and Dynamic Systems Link Prediction

Steffen [email protected]

3WeST

Social Network

Person Friendship

Page 4: Steffen Staab 1WeST Web Science  Technologies University of Koblenz ▪ Landau, Germany Network Theory and Dynamic Systems Link Prediction

Steffen [email protected]

4WeST

Recommender Systems

Predict who I will add as friend next

Standard algorithm: find friends-of-friends

me

Page 5: Steffen Staab 1WeST Web Science  Technologies University of Koblenz ▪ Landau, Germany Network Theory and Dynamic Systems Link Prediction

Steffen [email protected]

5WeST

Friend of a Friend

1 2 4 5 6

3

Count the number of ways a person can be found as the friend of a friend.

Page 6: Steffen Staab 1WeST Web Science  Technologies University of Koblenz ▪ Landau, Germany Network Theory and Dynamic Systems Link Prediction

Steffen [email protected]

6WeST

Adjacency Matrix

0 1 0 0 0 01 0 1 1 0 00 1 0 1 0 00 1 1 0 1 00 0 0 1 0 10 0 0 0 1 0

Aij = 1 when i and j are connectedAij = 0 when i and j are not connected

A is square and symmetric

1 2 4 5 6

3

A =

1

23

45

6

1 2 3 4 5 6

Page 7: Steffen Staab 1WeST Web Science  Technologies University of Koblenz ▪ Landau, Germany Network Theory and Dynamic Systems Link Prediction

Steffen [email protected]

7WeST

Baseline: Friend of a Friend Model

Count the number of ways a person can be found as the friend of a friend

Matrix product AA = A2

1 2 4

30 1 0 0 0 01 0 1 1 0 00 1 0 1 0 00 1 1 0 1 00 0 0 1 0 10 0 0 0 1 0

1 0 1 1 0 00 3 1 1 1 01 1 2 1 1 01 1 1 3 0 10 1 1 0 2 00 0 0 1 0 1

=

2

A2 =

Page 8: Steffen Staab 1WeST Web Science  Technologies University of Koblenz ▪ Landau, Germany Network Theory and Dynamic Systems Link Prediction

Steffen [email protected]

8WeST

Matrix product AA = A2

Friend of a Friend Computation

1 2 4

3

=

2

A2 =

0 1 0 0 0 01 0 1 1 0 00 1 0 1 0 00 1 1 0 1 00 0 0 1 0 10 0 0 0 1 0

1 0 1 1 0 00 3 1 1 1 01 1 2 1 1 01 1 1 3 0 10 1 1 0 2 00 0 0 1 0 1

Page 9: Steffen Staab 1WeST Web Science  Technologies University of Koblenz ▪ Landau, Germany Network Theory and Dynamic Systems Link Prediction

Steffen [email protected]

9WeST

Recommender Systems

Predict who I will add as friend next

Standard algorithm: find friends-of-friends → Problem: Rest of the network is ignored!

:-(

me

Page 10: Steffen Staab 1WeST Web Science  Technologies University of Koblenz ▪ Landau, Germany Network Theory and Dynamic Systems Link Prediction

Steffen [email protected]

10WeST

Friend of a Friend of a Friend

1 2 4 5 6

3

Count the number of ways a person can be found as the friend of a friend of a friend.

Page 11: Steffen Staab 1WeST Web Science  Technologies University of Koblenz ▪ Landau, Germany Network Theory and Dynamic Systems Link Prediction

Steffen [email protected]

11WeST

Friend of a Friend of a Friend

Compute the number of friends-of-friends-of-friends:

Idea: Link recommendation by highest scoreProblem: A3 is not sparse!

1 2 4 5 6

3

1 2 3 4 5 6123456

0 1 0 0 0 01 0 1 1 0 00 1 0 1 0 00 1 1 0 1 00 0 0 1 0 10 0 0 0 1 0

0 3 1 1 1 03 2 4 5 1 11 4 2 4 1 11 5 4 2 4 01 1 1 4 0 20 1 1 0 2 0

3

=A3 =

Page 12: Steffen Staab 1WeST Web Science  Technologies University of Koblenz ▪ Landau, Germany Network Theory and Dynamic Systems Link Prediction

Steffen [email protected]

12WeST

Eigenvalue Decomposition

A = UΛU-1

whereU are the eigenvectorsΛ are the eigenvalues Λij = 0

when i ≠ j

Λ is also called the spectrum of AProblem: complexity of computing U-1.

Page 13: Steffen Staab 1WeST Web Science  Technologies University of Koblenz ▪ Landau, Germany Network Theory and Dynamic Systems Link Prediction

Steffen [email protected]

13WeST

Problem: complexity of computing U-1.

Exploit U:• U-1 = UT because U contains normalized eigenvectors (U is orthogonal)

A = UΛU-1 = UΛUT

Page 14: Steffen Staab 1WeST Web Science  Technologies University of Koblenz ▪ Landau, Germany Network Theory and Dynamic Systems Link Prediction

Steffen [email protected]

14WeST

A0 1 0 0 0 01 0 1 1 0 00 1 0 1 0 00 1 1 0 1 00 0 0 1 0 10 0 0 0 1 0

Λ UU

Eigenvalue Decomposition: Example

1 2 4 5 6

3

Eigenvector Eigenvalue

U contains eigenvectors, Λ contains eigenvalues

=

−1 .74 0 0 0 0 00 −1 .37 0 0 0 00 0 −0 .59 0 0 00 0 0 0 .27 0 00 0 0 0 1.10 00 0 0 0 0 2 .33

T

Page 15: Steffen Staab 1WeST Web Science  Technologies University of Koblenz ▪ Landau, Germany Network Theory and Dynamic Systems Link Prediction

Steffen [email protected]

16WeST

AΛ UU

Eigenvector-Centrality

1 2 4 5 6

3

Eigenvector Eigenvalue

U contains eigenvectors, Λ contains eigenvalues

0.55 0.56 0.30 0.13

0.48

0.23

=

−1 .74 0 0 0 0 00 −1 .37 0 0 0 00 0 −0 .59 0 0 00 0 0 0 .27 0 00 0 0 0 1.10 00 0 0 0 0 2 .33

T

Page 16: Steffen Staab 1WeST Web Science  Technologies University of Koblenz ▪ Landau, Germany Network Theory and Dynamic Systems Link Prediction

Steffen [email protected]

18WeST

0 3 1 1 1 03 2 4 5 1 11 4 2 4 1 11 5 4 2 4 01 1 1 4 0 20 1 1 0 2 0

Computing A3

1 2 3 4 5 612345

6

A3 =

Use the eigenvalue decomposition A = UΛUT

A3 = UΛUT UΛUT UΛUT = UΛ3UT

Page 17: Steffen Staab 1WeST Web Science  Technologies University of Koblenz ▪ Landau, Germany Network Theory and Dynamic Systems Link Prediction

Steffen [email protected]

19WeST

Computing A3

Exploit U and Λ:• U-1 = UT because U contains

eigenvectors• UTU = I because U-1 = UT

• (Λk)ii = Λiik because Λ contains eigenvalues

A3 = UΛUT UΛUT UΛUT = UΛΛΛUT = UΛ3UT

Page 18: Steffen Staab 1WeST Web Science  Technologies University of Koblenz ▪ Landau, Germany Network Theory and Dynamic Systems Link Prediction

Steffen [email protected]

20WeST

Link Prediction

Prediction for node i: (A3)i * = (U Λ3 UT)i * = Ui * Λ3 UT

A3 = ( ) i * =iU Λ3 UT

U i * Λ3 UT i=

Optional: reduction to most dominant eigenvectors

fast ;)

Page 19: Steffen Staab 1WeST Web Science  Technologies University of Koblenz ▪ Landau, Germany Network Theory and Dynamic Systems Link Prediction

Steffen [email protected]

21WeST

Recommender Systems

Predict who I will add as friend next

Standard algorithm: find friends-of-friends → Problem: all paths have the same weights!

:-(

me

Page 20: Steffen Staab 1WeST Web Science  Technologies University of Koblenz ▪ Landau, Germany Network Theory and Dynamic Systems Link Prediction

Steffen [email protected]

22WeST 22

Follow paths

Number of paths of length k given by Ak

Nodes connected by many paths Nodes connected by short paths

Weight powers of A: αA² + βA³ + γA⁴ … with α > β > γ … [ > 0 ]

Examples:Exponential graph kernel: eαA = Σi αi/i!

Ai

Path Counting

Page 21: Steffen Staab 1WeST Web Science  Technologies University of Koblenz ▪ Landau, Germany Network Theory and Dynamic Systems Link Prediction

Steffen [email protected]

23WeST

exp(A) = I + A + 1/2 A2 + 1/6 A3 + . . .1 .66 1.72 0 .93 0 .98 0 .28 0 .06 0 .011.72 3 .57 2.70 2.93 1.04 0 .29 0 .060 .93 2.70 2.86 2 .71 0 .99 0 .28 0 .060 .98 2.93 2.71 3 .63 1.95 0 .76 0 .220 .28 1 .04 0 .99 1.95 2 .35 1 .59 0 .640 .06 0 .29 0 .28 0 .76 1 .59 2 .23 1 .380 .01 0 .06 0.06 0 .22 0 .64 1 .38 1 .59

Matrix Exponential

1 2 4 5

3

1 2 3 4 5 61234566

0 1 0 0 0 0 01 0 1 1 0 0 00 1 0 1 0 0 00 1 1 0 1 0 00 0 0 1 0 1 00 0 0 0 1 0 10 0 0 0 0 1 0

exp =

76

7

7

0.98 0.76 0.22

Page 22: Steffen Staab 1WeST Web Science  Technologies University of Koblenz ▪ Landau, Germany Network Theory and Dynamic Systems Link Prediction

Steffen [email protected]

24WeST

Spectral Transformations

Friend of a friend

Friend of a friend of a friend

Matrix exponential

…are link prediction functions!

A2 = UΛ2UT

A3 = UΛ3UT

exp(A) = Uexp(Λ)UT

Page 23: Steffen Staab 1WeST Web Science  Technologies University of Koblenz ▪ Landau, Germany Network Theory and Dynamic Systems Link Prediction

Steffen [email protected]

25WeST

Summary - Why the Matrix Exponential

An = Number of paths of length n

aA2 + bA3 + cA4 + . . .= Number of paths, weighted by path

length

→ New edges more likely to appear when there are many paths already

→ When a > b > c > . . . > 0, short paths are weighted higher