CS 521 Data Mining Techniques Instructor: Abdullah Mueen LECTURE 8: TIME SERIES AND GRAPH MINING
Definition of Time Series Motifs 1. Length of the motif 2. Support of the motif 3. Similarity of the Pattern 4. Relative Position of the Pattern Given a length, the most similar/least distant pair of non-overlapping subsequences
Problem Formulation The most similar pair of non- overlapping subsequences time:1000 The closest pair of points in high dimensional space Optimal algorithm in two dimension : Θ(n log n) For large dimensionality d, optimum algorithm is effectively Θ(n 2 d)
Lower Bound If P, Q and R are three points in a d-space d(P,Q)+d(Q,R) ≥ d(P,R) d(P,Q) ≥ |d(Q,R) - d(P,R)| A third point R provides a very inexpensive lower bound on the true distance If the lower bound is larger than the existing best, skip d(P, Q) d(P,Q) ≥ |d(Q,R) - d(P,R)| ≥ BestPairDistance PQ R
Circular Projection r r Pick a reference point r Circularly Project all points on a line passing through the reference point r distance Equivalent to computing distance from r and then sorting the points according to distance r
The Order Line r P Q r |d(Q, r) - d(P, r)| d(Q, r) d(P, r) k = 1 k = 2 k = 3 k=1:n-1 Compare every pair having k-1 points in between Compare every pair having k-1 points in between Do k scans of the order line, starting with the 1 st to k th point Do k scans of the order line, starting with the 1 st to k th point BestPairDistance r 0
Correctness If we search for all offset=1,2,…,n-1 then all possible pairs are considered. If we search for all offset=1,2,…,n-1 then all possible pairs are considered. ◦n(n-1)/2 pairs for any offset=k, if none of the k scans needs an actual distance computation then for the rest of the offsets=k+1,…,n-1 no distance computation will be needed. for any offset=k, if none of the k scans needs an actual distance computation then for the rest of the offsets=k+1,…,n-1 no distance computation will be needed. r
Graph Similarity Edit distance/graph isomorphism: ◦Tree Edit Distance Feature extraction ◦IN/out degree ◦Diameter Iterative methods ◦SimRank
Diameter Largest Shortest path in the graph. 1 let dist be a |V| × |V| array of minimum distances initialized to ∞ (infinity) 2 for each vertex v 3 dist[v][v] ← 0 4 for each edge (u,v) 5 dist[u][v] ← w(u,v) // the weight of the edge (u,v) 6 for k from 1 to |V| 7 for i from 1 to |V| 8 for j from 1 to |V| 9 if dist[i][j] > dist[i][k] + dist[k][j] 10 dist[i][j] ← dist[i][k] + dist[k][j] 11 end if
Simrank For a node v in a graph, we denote by I(v) and O(v) the set of in-neighbors and out-neighbors of v, respectively. 1.A solution s( ∗, ∗ ) ∈ [0, 1] to the n 2 SimRank equations always exists and is unique. 2.Symmetric 3.Reflexive
Tree Edit Distance
Tree Edit Distance
Applications Find the most frequent tree structure in a phylogenetic tree. Match a query subtree with a set of XML documents.
Ranking Nodes Page Rank PR(A) is the PageRank of page A, PR(Ti) is the PageRank of pages Ti which link to page A, C(Ti) is the number of outbound links on page Ti and d is a damping factor which can be set between 0 and 1. PR(A) = (1-d) + d (PR(T1)/C(T1) PR(Tn)/C(Tn))
Example PR(A) = PR(C) PR(B) = (PR(A) / 2) PR(C) = (PR(A) / 2 + PR(B)) These equations can easily be solved. We get the following PageRank values for the single pages: PR(A) = 14/13 = PR(B) = 10/13 = PR(C) = 15/13 =
Matlab Script Matlab script for the example in the previous slide syms x y z; eqn1 = x == *z eqn2 = y == *x eqn3 = z == *x + 0.5*y [A,B] = equationsToMatrix([eqn1, eqn2, eqn3], [x, y, z]) X = linsolve(A,B)
HITS: Hyperlink-Induced Topic Search