Docsity

Exam 2 Solution - Database Mining - Fall 2011 | CSCI 4390, Exams of Computer Science

Toggle sidebar
bg1
CSCI4390/6390 – Data Mining
Fall 2011, Exam II
Total Points: 100 + 10 (bonus)
A
A
G
(4,2)
CAGAA$
(1,4)
(3,2)
T$
(4,8)
$
(2,3)
CAG$
G
AA
(1,2)
GT$
(4,6)
$
(4,3)
CAAGA$
(1,5)
(3,3)
T$
(2,5)
$
(4,9)
$
CAG
AA
(1,1)
GT$
(4,5)
$
(2,4)
$
G
A
A
G
(1,3)
(3,1)
T$
(4,1)
CAGAA$
(4,7)
$
(2,2)
CAG$
(4,4)
CAGAA$
(1,6)
(3,4)
T$
(2,6)
$
T
(2,1)
GACAG$
(1,7)
(3,5)
$
Figure 1: Suffix Tree
1. (35 points) Given the four sequences:
s1=CAGAAGT
s2=T GACAG
s3=GAAGT
s4=GAAGCAGAA
(a) (10 points) The suffix tree for these four sequences is shown in Figure 1. Use this tree to
find all the closed substrings with minsup = 2. Recall that a substring is a consecutive
subsequence, and closed means that there is no superstring with the same support. In
the tree, a leaf entry (i, j) means the j-th suffix of i-th sequence.
Answer: From the suffix tree, in one traversal, we can record the following frequent
substrings, namely those that appear in at least sequences: AAGT - 2, AA - 3, AGAA
- 2, AGT - 2, AG - 4, A - 4, CAGAA - 2, CAG - 3, GAAGT - 2, GAAG - 3, GAA - 3,
GA - 4, GT - 2, G - 4, T - 2.
The closed frequent substrings are therefore: AG - 4, CAGAA - 2, CAG - 3, GAAGT -
2, GAAG - 3, GA - 4
pf3
pf4
pf5

Partial preview of the text

Download Exam 2 Solution - Database Mining - Fall 2011 | CSCI 4390 and more Exams Computer Science in PDF only on Docsity!

CSCI4390/6390 – Data Mining

Fall 2011, Exam II

Total Points: 100 + 10 (bonus)

A

A

G

(4,2)

CAGAA$

(1,4) (3,2)

T$

(4,8)

$

(2,3)

CAG$ G

AA

(1,2)

GT$

(4,6)

$

(4,3)

CAAGA$

(1,5) (3,3)

T$

(2,5)

$

(4,9)

$

CAG

AA

(1,1)

GT$

(4,5)

$

(2,4)

$

G

A

A

G

(1,3) (3,1)

T$

(4,1)

CAGAA$

(4,7)

$

(2,2)

CAG$

(4,4)

CAGAA$

(1,6) (3,4)

T$

(2,6)

$

T

(2,1)

GACAG$

(1,7) (3,5)

$

Figure 1: Suffix Tree

  1. (35 points) Given the four sequences: s 1 = CAGAAGT s 2 = T GACAG s 3 = GAAGT s 4 = GAAGCAGAA

(a) (10 points) The suffix tree for these four sequences is shown in Figure 1. Use this tree to find all the closed substrings with minsup = 2. Recall that a substring is a consecutive subsequence, and closed means that there is no superstring with the same support. In the tree, a leaf entry (i, j) means the j-th suffix of i-th sequence. Answer: From the suffix tree, in one traversal, we can record the following frequent substrings, namely those that appear in at least sequences: AAGT - 2, AA - 3, AGAA

  • 2, AGT - 2, AG - 4, A - 4, CAGAA - 2, CAG - 3, GAAGT - 2, GAAG - 3, GAA - 3, GA - 4, GT - 2, G - 4, T - 2. The closed frequent substrings are therefore: AG - 4, CAGAA - 2, CAG - 3, GAAGT - 2, GAAG - 3, GA - 4

(b) (10 points) Find all frequent maximal sequences with minsup = 3. You may use any method of your choice. Recall that maximal means that there is no frequent superse- quence. Answer: Let us apply a level-wise method to mine the frequent subsequences, and then we can extract the maximal ones. level 1: A - 4, C - 3, G - 4, T - 3 level 2: AA - 4, AG - 4, GA - 4, GG - 4, CA - 3, CG - 3 level 3: AAG - 4, CAG - 3, GAA - 4, GAG - 4 level 4: GAAG - 4

The maximal ones are: GAAG - 4, CAG - 3, T - 3 (c) (15 points) Find the negative border of the set of frequent sequences with minsup = 3. Negative border is defined as the set of minimal infrequent subsequences. That is, an infrequent sequence all of whose subsequences are frequent. Answer: The minimal infrequent sequences can be found from those that were found to be infrequent in the question above. That is, once a subsequence is found to be infre- quent, no supersequence of that can be minimal, thus, for each infrequent subsequence we have to check if any of its subsequences is infrequent. If so, it cannot be minimal. The set of minimal infrequent sequences checked in the question above are as follows: AC, AT, AAA, AGA, AGG CC, CT, CAA, CGA, CGG GC, GT, GGA, GGG TA, TC, TG, TT

X 1 X 2 Class αi x 1 3.4 4 − 1 1. x 2 2 4 − 1 0 x 3 9.1 4.5 +1 0. x 4 2 6 − 1 0 x 5 1.5 7 − 1 0 x 6 2.1 2.5 +1 1. x 7 7 6.5 − 1 0 x 8 8 4 +1 0 (a) Classification Dataset

a

v 0 b

v 1

b

v 2

b v 3

b v 4

a v 5

x y

y y y

y (^) z

(b) Edge Labeled Graph

  1. (30 points) Consider the classification dataset in Figure 2a. Let the Lagrangian multipliers be as shown in the last column. Answer the following questions

(a) (15 points) Compute the weight vector and the bias for the optimal hyperplane. You may assume that C = 10. Answer: The weight vector is given as

w = − 1. 7

K(x 6 , x 6 ) = (10.66)^2 = 113. 6

The kernel matrix is therefore

K =

(b) (10 points) Compute the direction of most variance in feature space. For the eigenvec- tor/eigenvalue computation, you need to carry out at most three iterations. There is no need to center the kernel matrix K. Also, since the entires of K will be large, feel free to scale the matrix by dividing by some scalar, since that will not change the eigenvector (it only effects the eigenvalue). For example, if K′^ = K/s, for some scalar s (e.g., 100), and if λ′^ is the eigenvalue of K′, then λ = sλ′^ is the eigenvalue of K. The eigenvector corresponding to λ′^ and λ is the same. Answer: Since K have very large entries, we can scale it by any constant. For example, let s = 100, so that

K′^ = K/100 =

Let x 0 =

, we then find the eigenvector/eigenvalue as follows:

x 1 =

x 2 =

x 3 =

The eigenvalue is λ′^ = 112.6.

Thus c = (^) ‖xx^32 ‖ = (^1). 03021

The corresponding eigenvalue of K is λ = 100 × 112 .6 = 11260 We have to normalize c by √^1 λ to get a normalized direction u 1 in feature space; we have:

c = √ 112601

(c) (5 points) What is the projection of x 1 onto the first kernel principal component. Answer: Let K 1 be the column of K corresponding to K(·, x 1 ). The projection of x 1 onto the principal component is given as: KT 1 c = (^2521106) .. 1106 = 23. 76

  1. (15 points) Find the minimum DFS code for the graph in Figure 2b.

Answer: The minDFS code is as follows: 0,1,a,b,x 1,2,b,b,y 2,3,b,b,y 3,1,b,b,y 3,4,b,b,y 4,2,b,b,y 4,5,b,a,z

  1. (Bonus: 10 points) For an edge labeled graph G = (V, E), define its labeled adjacency matrix A as follows:

A(i, j) =

l(vi) If i = j l(vi, vj ) If (vi, vj ) ∈ E 0 Otherwise where l(vi) is the label for vertex vi and l(vi, vj ) is the label for edge (vi, vj ). In other words, the labeled adjacency matrix has the node labels on the main diagonal, and it has the label of an edge (vi, vj ) in cell A(i, j). Finally, a 0 in cell A(i, j) means that there is no edge between vi and vj. Since the graph is assumed to be undirected, A is symmetric. Given a particular permutation of the vertices, the code for the corresponding labeled adja- cency matrix is obtained by concatenating the lower triangular A row-by-row. For example, one possible matrix corresponding to the default vertex permutation v 0 v 1 v 2 v 3 v 4 v 5 for the graph in Figure 2b is given as a x b 0 y b 0 y y b 0 0 y y b 0 0 0 0 z a The code for the matrix above is axb 0 yb 0 yyb 00 yyb 0000 za. Given the ordering on the labels/entires of the adjacency matrix 0 < a < b < x < y < z, find the maximum matrix code for the graph in Figure 2b. That is, among all possible vertex permutations and the corresponding codes, you have to choose the lexicographically largest code. Answer: The maximum code is bybyybyy 0 b 00 z 0 a 000 x 0 a, which corresponds to the matrix: b x b y y b y y 0 b 0 0 z 0 a 0 0 0 x 0 a corresponding to the permutation v 3 v 2 v 4 v 1 v 5 v 0.