Presentation is loading. Please wait.

Presentation is loading. Please wait.

Jure Leskovec and Christos Faloutsos Machine Learning Department

Similar presentations


Presentation on theme: "Jure Leskovec and Christos Faloutsos Machine Learning Department"— Presentation transcript:

1 Jure Leskovec and Christos Faloutsos Machine Learning Department
Tools for large graph mining WWW 2008 tutorial Part 3: Matrix tools for graph mining Jure Leskovec and Christos Faloutsos Machine Learning Department Joint work with: Deepay Chakrabarti, Tamara Kolda and Jimeng Sun.

2 Leskovec&Faloutsos, WWW 2008
Tutorial outline Part 1: Structure and models for networks What are properties of large graphs? How do we model them? Part 2: Dynamics of networks Diffusion and cascading behavior How do viruses and information propagate? Part 3: Matrix tools for mining graphs Singular value decomposition (SVD) Random walks Part 4: Case studies 240 million MSN instant messenger network Graph projections: how does the web look like Leskovec&Faloutsos, WWW 2008

3 Leskovec&Faloutsos, WWW 2008
Faloutsos, Kolda, Sun About part 3 Introduce matrix and tensor tools through real mining applications Goal: find patterns, rules, clusters, outliers, … in matrices and in tensors Leskovec&Faloutsos, WWW 2008

4 Leskovec&Faloutsos, WWW 2008
What is this part about? Connection of matrix tools and networks Matrix tools Singular Value Decomposition (SVD) Principal Component Analysis (PCA) Webpage ranking algorithms: HITS, PageRank CUR decomposition Co-clustering Tensor tools Tucker decomposition Applications Leskovec&Faloutsos, WWW 2008

5 Leskovec&Faloutsos, WWW 2008
Why matrices? Examples Social networks Documents and terms Authors and terms Peter Mary Nick John ... John Peter Mary Nick ... 11 22 55 ... 5 6 7 Leskovec&Faloutsos, WWW 2008

6 Leskovec&Faloutsos, WWW 2008
Why matrices? Examples Social networks Documents and terms Authors and terms Peter Mary Nick John ... John Peter Mary Nick ... 11 22 55 ... 5 6 7 Leskovec&Faloutsos, WWW 2008

7 Leskovec&Faloutsos, WWW 2008
Why tensors? Example Tensor: n-dimensional generalization of matrix SIGMOD’07 data mining classif. tree ... John Peter Mary Nick Leskovec&Faloutsos, WWW 2008

8 Leskovec&Faloutsos, WWW 2008
Why tensors? Example Tensor: n-dimensional generalization of matrix SIGMOD’05 SIGMOD’06 SIGMOD’07 data mining classif. tree ... John Peter Mary Nick Leskovec&Faloutsos, WWW 2008

9 Tensors are useful for 3 or more modes
Faloutsos, Kolda, Sun Tensors are useful for 3 or more modes Terminology: ‘mode’ (or ‘aspect’): Mode#3 data mining classif. tree ... Mode#2 Mode (== aspect) #1 Leskovec&Faloutsos, WWW 2008

10 Motivating applications
Faloutsos, Kolda, Sun Motivating applications Social networks Why matrices are important? Why tensors are useful? P1: social networks P2: web & text mining P3: network forensics P4: sensor networks Sensor networks Network forensics Temperature normal traffic abnormal traffic destination source Leskovec&Faloutsos, WWW 2008

11 Leskovec&Faloutsos, WWW 2008
Faloutsos, Kolda, Sun Static Data model Tensor Formally, Generalization of matrices Represented as multi-array, (~ data cube). Order 1st 2nd 3rd Correspondence Vector Matrix 3D array Example Leskovec&Faloutsos, WWW 2008

12 Leskovec&Faloutsos, WWW 2008
Faloutsos, Kolda, Sun Dynamic Data model Tensor Streams A sequence of Mth order tensors where t is increasing over time Order 1st 2nd 3rd Correspondence Multiple streams Time evolving graphs 3D arrays Example keyword time time author Leskovec&Faloutsos, WWW 2008

13 SVD: Examples of Matrices
Faloutsos, Kolda, Sun SVD: Examples of Matrices Example/Intuition: Documents and terms Find patterns, groups, concepts data mining classif. tree ... Paper#1 Paper#2 Paper#3 Paper#4 ... Leskovec&Faloutsos, WWW 2008

14 Singular Value Decomposition (SVD)
Faloutsos, Kolda, Sun Singular Value Decomposition (SVD) X = UVT X U x(1) x(2) x(M) u1 u2 uk VT v1 v2 vk 1 2 . . = k right singular vectors singular values input data left singular vectors Leskovec&Faloutsos, WWW 2008

15 SVD as spectral decomposition
Faloutsos, Kolda, Sun SVD as spectral decomposition Best rank-k approximation in L2 and Frobenius SVD only works for static matrices (a single 2nd order tensor) n n 1u1v1 2u2v2 m A VT + m U Leskovec&Faloutsos, WWW 2008

16 Vector outer product – intuition:
owner age 20; 30; 40 20; 30; 40 car type VW Volvo BMW VW Volvo BMW A 1-d histograms + independence assumption 2-d histogram Leskovec&Faloutsos, WWW 2008

17 Leskovec&Faloutsos, WWW 2008
Faloutsos, Kolda, Sun SVD - Example A = U  VT - example: retrieval inf. lung brain data CS x x = MD Leskovec&Faloutsos, WWW 2008

18 Leskovec&Faloutsos, WWW 2008
Faloutsos, Kolda, Sun SVD - Example A = U  VT - example: retrieval CS-concept inf. lung MD-concept brain data CS x x = MD Leskovec&Faloutsos, WWW 2008

19 Leskovec&Faloutsos, WWW 2008
Faloutsos, Kolda, Sun SVD - Example doc-to-concept similarity matrix A = U  VT - example: retrieval CS-concept inf. lung MD-concept brain data CS x x = MD Leskovec&Faloutsos, WWW 2008

20 Leskovec&Faloutsos, WWW 2008
Faloutsos, Kolda, Sun SVD - Example A = U  VT - example: retrieval ‘strength’ of CS-concept inf. lung brain data CS x x = MD Leskovec&Faloutsos, WWW 2008

21 Leskovec&Faloutsos, WWW 2008
Faloutsos, Kolda, Sun SVD - Example A = U  VT - example: term-to-concept similarity matrix retrieval inf. lung brain data CS-concept CS x x = MD Leskovec&Faloutsos, WWW 2008

22 Leskovec&Faloutsos, WWW 2008
Faloutsos, Kolda, Sun SVD - Example A = U  VT - example: term-to-concept similarity matrix retrieval inf. lung brain data CS-concept CS x x = MD Leskovec&Faloutsos, WWW 2008

23 Leskovec&Faloutsos, WWW 2008
Faloutsos, Kolda, Sun SVD - Interpretation ‘documents’, ‘terms’ and ‘concepts’: Q: if A is the document-to-term matrix, what is AT A? A: term-to-term ([m x m]) similarity matrix Q: A AT ? A: document-to-document ([n x n]) similarity matrix Leskovec&Faloutsos, WWW 2008

24 Leskovec&Faloutsos, WWW 2008
Faloutsos, Kolda, Sun SVD properties V are the eigenvectors of the covariance matrix ATA U are the eigenvectors of the Gram (inner-product) matrix AAT Further reading: 1. Ian T. Jolliffe, Principal Component Analysis (2nd ed), Springer, 2002. 2. Gilbert Strang, Linear Algebra and Its Applications (4th ed), Brooks Cole, 2005. Leskovec&Faloutsos, WWW 2008

25 Principal Component Analysis (PCA)
Faloutsos, Kolda, Sun Principal Component Analysis (PCA) SVD PCA is an important application of SVD Note that U and V are dense and may have negative entries n n R k k k VT A U m m Loading PCs Leskovec&Faloutsos, WWW 2008

26 Leskovec&Faloutsos, WWW 2008
Faloutsos, Kolda, Sun PCA interpretation best axis to project on: (‘best’ = min sum of squares of projection errors) Term2 (‘lung’) Term1 (‘data’) Leskovec&Faloutsos, WWW 2008

27 Leskovec&Faloutsos, WWW 2008
Faloutsos, Kolda, Sun PCA - interpretation U VT Term2 (‘retrieval’) PCA projects points Onto the “best” axis first singular vector v1 minimum RMS error Term1 (‘data’) Leskovec&Faloutsos, WWW 2008

28 Kleinberg’s algorithm HITS
Faloutsos, Kolda, Sun Kleinberg’s algorithm HITS Problem definition: given the web and a query find the most ‘authoritative’ web pages for this query Step 0: find all pages containing the query terms Step 1: expand by one move forward and backward Further reading: 1. J. Kleinberg. Authoritative sources in a hyperlinked environment. SODA 1998 Leskovec&Faloutsos, WWW 2008

29 Kleinberg’s algorithm HITS
Faloutsos, Kolda, Sun Kleinberg’s algorithm HITS Step 1: expand by one move forward and backward Leskovec&Faloutsos, WWW 2008

30 Kleinberg’s algorithm HITS
Faloutsos, Kolda, Sun Kleinberg’s algorithm HITS on the resulting graph, give high score (= ‘authorities’) to nodes that many important nodes point to give high importance score (‘hubs’) to nodes that point to good ‘authorities’ hubs authorities Leskovec&Faloutsos, WWW 2008

31 Kleinberg’s algorithm HITS
Faloutsos, Kolda, Sun Kleinberg’s algorithm HITS observations recursive definition! each node (say, ‘i’-th node) has both an authoritativeness score ai and a hubness score hi Leskovec&Faloutsos, WWW 2008

32 Kleinberg’s algorithm: HITS
Faloutsos, Kolda, Sun Kleinberg’s algorithm: HITS Let A be the adjacency matrix: the (i,j) entry is 1 if the edge from i to j exists Let h and a be [n x 1] vectors with the ‘hubness’ and ‘authoritativiness’ scores. Then: Leskovec&Faloutsos, WWW 2008

33 Kleinberg’s algorithm: HITS
Faloutsos, Kolda, Sun Kleinberg’s algorithm: HITS Then: ai = hk + hl + hm that is ai = Sum (hj) over all j that (j,i) edge exists or a = AT h k i l m Leskovec&Faloutsos, WWW 2008

34 Kleinberg’s algorithm: HITS
Faloutsos, Kolda, Sun Kleinberg’s algorithm: HITS symmetrically, for the ‘hubness’: hi = an + ap + aq that is hi = Sum (qj) over all j that (i,j) edge exists or h = A a i n p q Leskovec&Faloutsos, WWW 2008

35 Kleinberg’s algorithm: HITS
Faloutsos, Kolda, Sun Kleinberg’s algorithm: HITS In conclusion, we want vectors h and a such that: h = A a a = AT h That is: a = ATA a Leskovec&Faloutsos, WWW 2008

36 Kleinberg’s algorithm: HITS
Faloutsos, Kolda, Sun Kleinberg’s algorithm: HITS a is a right singular vector of the adjacency matrix A (by dfn!), a.k.a the eigenvector of ATA Starting from random a’ and iterating, we’ll eventually converge Q: to which of all the eigenvectors? why? A: to the one of the strongest eigenvalue, (AT A ) k a = 1ka Leskovec&Faloutsos, WWW 2008

37 Kleinberg’s algorithm - discussion
Faloutsos, Kolda, Sun Kleinberg’s algorithm - discussion ‘authority’ score can be used to find ‘similar pages’ (how?) closely related to ‘citation analysis’, social networks / ‘small world’ phenomena Leskovec&Faloutsos, WWW 2008

38 Motivating problem: PageRank
Faloutsos, Kolda, Sun Motivating problem: PageRank Given a directed graph, find its most interesting/central node A node is important, if it is connected with important nodes (recursive, but OK!) Leskovec&Faloutsos, WWW 2008

39 Motivating problem – PageRank solution
Faloutsos, Kolda, Sun Motivating problem – PageRank solution Given a directed graph, find its most interesting/central node Proposed solution: Random walk; spot most ‘popular’ node (-> steady state prob. (ssp)) A node has high ssp, if it is connected with high ssp nodes (recursive, but OK!) Leskovec&Faloutsos, WWW 2008

40 (Simplified) PageRank algorithm
Let A be the transition matrix (= adjacency matrix); let B be the transpose, column-normalized - then From B To 1 2 3 4 5 = Leskovec&Faloutsos, WWW 2008

41 (Simplified) PageRank algorithm
B p = p B p = p 2 1 3 = 4 5 Leskovec&Faloutsos, WWW 2008

42 (Simplified) PageRank algorithm
Faloutsos, Kolda, Sun (Simplified) PageRank algorithm B p = 1 * p thus, p is the eigenvector that corresponds to the highest eigenvalue (=1, since the matrix is column-normalized) Why does such a p exist? p exists if B is nxn, nonnegative, irreducible [Perron–Frobenius theorem] Leskovec&Faloutsos, WWW 2008

43 (Simplified) PageRank algorithm
Faloutsos, Kolda, Sun (Simplified) PageRank algorithm In short: imagine a particle randomly moving along the edges compute its steady-state probabilities (ssp) Full version of algo: with occasional random jumps Why? To make the matrix irreducible Leskovec&Faloutsos, WWW 2008

44 Leskovec&Faloutsos, WWW 2008
Faloutsos, Kolda, Sun Full Algorithm With probability 1-c, fly-out to a random node Then, we have p = c B p + (1-c)/n 1 => p = (1-c)/n [I - c B] -1 1 Leskovec&Faloutsos, WWW 2008

45 Leskovec&Faloutsos, WWW 2008

46 Motivation of CUR or CMD
Faloutsos, Kolda, Sun Motivation of CUR or CMD SVD, PCA all transform data into some abstract space (specified by a set basis) Interpretability problem Loss of sparsity Leskovec&Faloutsos, WWW 2008

47 Leskovec&Faloutsos, WWW 2008
Faloutsos, Kolda, Sun PCA - interpretation Term2 (‘retrieval’) PCA projects points Onto the “best” axis first singular vector v1 minimum RMS error Term1 (‘data’) Leskovec&Faloutsos, WWW 2008

48 Leskovec&Faloutsos, WWW 2008
Faloutsos, Kolda, Sun CUR Example-based projection: use actual rows and columns to specify the subspace Given a matrix ARmn, find three matrices C Rmc, U Rcr, R Rr n , such that ||A-CUR|| is small Orthogonal projection U is the pseudo-inverse of X Leskovec&Faloutsos, WWW 2008

49 Leskovec&Faloutsos, WWW 2008
Faloutsos, Kolda, Sun CUR Example-based projection: use actual rows and columns to specify the subspace Given a matrix ARmn, find three matrices C Rmc, U Rcr, R Rr n , such that ||A-CUR|| is small Example-based U is the pseudo-inverse of X: U = X† = (UT U )-1 UT Leskovec&Faloutsos, WWW 2008

50 Leskovec&Faloutsos, WWW 2008
Faloutsos, Kolda, Sun CUR (cont.) Key question: How to select/sample the columns and rows? Uniform sampling Biased sampling CUR w/ absolute error bound CUR w/ relative error bound Reference: Tutorial: Randomized Algorithms for Matrices and Massive Datasets, SDM’06 Drineas et al. Subspace Sampling and Relative-error Matrix Approximation: Column-Row-Based Methods, ESA2006 Drineas et al., Fast Monte Carlo Algorithms for Matrices III: Computing a Compressed Approximate Matrix Decomposition, SIAM Journal on Computing, 2006. Leskovec&Faloutsos, WWW 2008

51 The sparsity property – pictorially:
Faloutsos, Kolda, Sun The sparsity property – pictorially: SVD/PCA: Destroys sparsity = U S VT CUR: maintains sparsity animation = C U R Leskovec&Faloutsos, WWW 2008

52 Leskovec&Faloutsos, WWW 2008
Faloutsos, Kolda, Sun The sparsity property sparse and small SVD: A = U  VT Big but sparse Big and dense dense but small CUR: A = C U R Big but sparse Big but sparse Leskovec&Faloutsos, WWW 2008

53 Leskovec&Faloutsos, WWW 2008
Matrix tools - summary SVD: optimal for L2 – VERY popular (HITS, PageRank, Karhunen-Loeve, Latent Semantic Indexing, PCA, etc etc) C-U-R (CMD etc) near-optimal; sparsity; interpretability Leskovec&Faloutsos, WWW 2008

54 Leskovec&Faloutsos, WWW 2008
TENSORS Leskovec&Faloutsos, WWW 2008

55 Leskovec&Faloutsos, WWW 2008
Faloutsos, Kolda, Sun Reminder: SVD Best rank-k approximation in L2 n n m A VT m U Leskovec&Faloutsos, WWW 2008

56 Leskovec&Faloutsos, WWW 2008
Faloutsos, Kolda, Sun Reminder: SVD Best rank-k approximation in L2 n 1u1v1 2u2v2 A + m Leskovec&Faloutsos, WWW 2008

57 Goal: extension to >=3 modes
Faloutsos, Kolda, Sun Goal: extension to >=3 modes I x R K x R A B J x R C R x R x R I x J x K +…+ = Leskovec&Faloutsos, WWW 2008

58 Leskovec&Faloutsos, WWW 2008
Main points: 2 major types of tensor decompositions: PARAFAC and Tucker both can be solved with ``alternating least squares’’ (ALS) Details follow – we start with terminology: Leskovec&Faloutsos, WWW 2008

59 A tensor is a multidimensional array
Faloutsos, Kolda, Sun A tensor is a multidimensional array Column (Mode-1) Fibers Row (Mode-2) Fibers Tube (Mode-3) Fibers An I £ J £ K tensor K xijk I J Horizontal Slices Lateral Slices Frontal Slices 3rd order tensor mode 1 has dimension I mode 2 has dimension J mode 3 has dimension K Before we can get into multilinear algebra and its applications, we need to talk about multilinear arrays. Note: All my examples will be in 3d, but it all extends to higher dimensions as well. Note: Tutorial focus is on 3rd order, but everything can be extended to higher orders. Leskovec&Faloutsos, WWW 2008

60 Tucker Decomposition - intuition
Faloutsos, Kolda, Sun Tucker Decomposition - intuition I x J x K A I x R B J x S C K x T R x S x T author x keyword x conference A: author x author-group B: keyword x keyword-group C: conf. x conf-group G: how groups relate to each other Leskovec&Faloutsos, WWW 2008

61 Matrization: Converting a Tensor to a Matrix
Faloutsos, Kolda, Sun Matrization: Converting a Tensor to a Matrix (i,j,k) (i′,j′) Matricize (unfolding) Reverse Matricize X(n): The mode-n fibers are rearranged to be the columns of a matrix 5 7 6 8 Vectorization Leskovec&Faloutsos, WWW 2008

62 Tensor Mode-n Multiplication
Faloutsos, Kolda, Sun Tensor Mode-n Multiplication Tensor Times Matrix Tensor Times Vector Compute the dot product of a and each column (mode-1) fiber Multiply each row (mode-2) fiber by B Leskovec&Faloutsos, WWW 2008

63 Leskovec&Faloutsos, WWW 2008
Tensor tools - summary Two main tools PARAFAC Tucker Both find row-, column-, tube-groups but in PARAFAC the three groups are identical To solve: Alternating Least Squares Toolbox: from Tamara Kolda: Leskovec&Faloutsos, WWW 2008

64 P1: Environmental sensor monitoring
Faloutsos, Kolda, Sun P1: Environmental sensor monitoring Light Temperature Voltage Humidity Leskovec&Faloutsos, WWW 2008

65 Leskovec&Faloutsos, WWW 2008
Faloutsos, Kolda, Sun P1: sensor monitoring 1st factor Scaling factor 250 time location type Location Type Time light voltage 1st factor consists of the main trends: Daily periodicity on time Uniform on all locations Temp, Light and Volt are positively correlated while negatively correlated with Humid hum. temp. Leskovec&Faloutsos, WWW 2008

66 Leskovec&Faloutsos, WWW 2008
Faloutsos, Kolda, Sun P1: sensor monitoring type time location 2nd factor Scaling factor 154 2nd factor captures an atypical trend: Uniformly across all time Concentrating on 3 locations Mainly due to voltage Interpretation: two sensors have low battery, and the other one has high battery. light voltage hum. temp. Leskovec&Faloutsos, WWW 2008

67 P3: Social network analysis
Faloutsos, Kolda, Sun P3: Social network analysis Multiway latent semantic indexing (LSI) Monitor the change of the community structure over time Philip Yu time Michael Stonebreaker ‘Pattern’ ‘Query’ Leskovec&Faloutsos, WWW 2008

68 P3: Social network analysis (cont.)
Faloutsos, Kolda, Sun P3: Social network analysis (cont.) Authors Keywords Year michael carey, michael stonebreaker, h. jagadish, hector garcia-molina queri,parallel,optimization,concurr, objectorient 1995 surajit chaudhuri,mitch cherniack,michael stonebreaker,ugur etintemel distribut,systems,view,storage,servic,process,cache 2004 jiawei han,jian pei,philip s. yu, jianyong wang,charu c. aggarwal streams,pattern,support, cluster, index,gener,queri DB DM Two groups are correctly identified: Databases and Data mining People and concepts are drifting over time Leskovec&Faloutsos, WWW 2008

69 P4: Network anomaly detection
Faloutsos, Kolda, Sun P4: Network anomaly detection Abnormal traffic Reconstruction error over time Normal traffic Reconstruction error gives indication of anomalies. Prominent difference between normal and abnormal ones is mainly due to the unusual scanning activity (confirmed by the campus admin). Leskovec&Faloutsos, WWW 2008

70 Leskovec&Faloutsos, WWW 2008
Faloutsos, Kolda, Sun P5: Web graph mining How to order the importance of web pages? Kleinberg’s algorithm HITS PageRank Tensor extension on HITS (TOPHITS) 8 mins Leskovec&Faloutsos, WWW 2008

71 Kleinberg’s Hubs and Authorities (the HITS method)
Faloutsos, Kolda, Sun Kleinberg’s Hubs and Authorities (the HITS method) Sparse adjacency matrix and its SVD: authority scores for 2nd topic authority scores for 1st topic to from hub scores for 1st topic hub scores for 2nd topic Kleinberg, JACM, 1999 Leskovec&Faloutsos, WWW 2008

72 HITS Authorities on Sample Data
Faloutsos, Kolda, Sun HITS Authorities on Sample Data We started our crawl from and crawled 4700 pages, resulting in cross-linked hosts. authority scores for 2nd topic authority scores for 1st topic to from hub scores for 1st topic hub scores for 2nd topic Leskovec&Faloutsos, WWW 2008

73 Three-Dimensional View of the Web
Faloutsos, Kolda, Sun Three-Dimensional View of the Web Observe that this tensor is very sparse! Kolda, Bader, Kenny, ICDM05 Leskovec&Faloutsos, WWW 2008

74 Topical HITS (TOPHITS)
Faloutsos, Kolda, Sun Topical HITS (TOPHITS) Main Idea: Extend the idea behind the HITS model to incorporate term (i.e., topical) information. term scores for 1st topic term scores for 2nd topic term to from authority scores for 1st topic authority scores for 2nd topic hub scores for 2nd topic hub scores for 1st topic Leskovec&Faloutsos, WWW 2008

75 Topical HITS (TOPHITS)
Faloutsos, Kolda, Sun Topical HITS (TOPHITS) Main Idea: Extend the idea behind the HITS model to incorporate term (i.e., topical) information. term scores for 1st topic term scores for 2nd topic term to from authority scores for 1st topic authority scores for 2nd topic hub scores for 2nd topic hub scores for 1st topic Leskovec&Faloutsos, WWW 2008

76 TOPHITS Terms & Authorities on Sample Data
Faloutsos, Kolda, Sun TOPHITS Terms & Authorities on Sample Data TOPHITS uses 3D analysis to find the dominant groupings of web pages and terms. wk = # unique links using term k Tensor term scores for 1st topic term scores for 2nd topic term to from authority scores for 1st topic authority scores for 2nd topic hub scores for 2nd topic hub scores for 1st topic Leskovec&Faloutsos, WWW 2008

77 Leskovec&Faloutsos, WWW 2008
Faloutsos, Kolda, Sun Conclusions Real data are often in high dimensions with multiple aspects (modes) Matrices and tensors provide elegant theory and algorithms Several research problems are still open skewed distribution, anomaly detection, streaming algorithms, distributed/parallel algorithms, efficient out-of-core processing Leskovec&Faloutsos, WWW 2008

78 Leskovec&Faloutsos, WWW 2008
References Slides borrowed from SIGMOD ‘07 tutorial by Falutsos, Kolda and Sun. Leskovec&Faloutsos, WWW 2008


Download ppt "Jure Leskovec and Christos Faloutsos Machine Learning Department"

Similar presentations


Ads by Google