list - Answers ordered
sets - Answers not ordered
support of an itemset - Answers number of all the transactions contained in all the items in A
association rule - Answers is a statement of the form A à B, where A and Bare itemsets
Support of A --> B - Answers is the number of data sets that contain A and B
Confidence of A ---> B - Answers |AB|/|A| is the conditional probability of B given A
Apriori Algorithm - Answers step 1)
compute the support of all item sets from size 1 till there are none keep all with s greater than 1
While assuming C = 99 and s = 2
step 2) find out what meets our contraints of c=99 and s=2
by testing all of the values from step 1 that we kept to see of they meet our constraints.
how to compute the number of possible item sets - Answers n number of items chose 1... n
added together
distance metrics letters and numbers with counted zeros - Answers for non numbers
E.g., two answers to 5 multiple-choice questions• (a,b,a,c,d) vs. (a,b,c,c,b). Distance = 2
for numbers
Euclidean distance = sqrt( (1-2)2 + (1-3)2 ) = sqrt(5) hypotenuse
• Manhattan distance = = |1-2| + |1-3| = 3 like city blocks
distance metrics boolean - Answers Boolean vectors where matching zeros don't count•
Jaccard similarity = # of matching ones / # of coordinates with at least one one• J
accard(100000,000101) = 0/3•
Jaccard(100000,100101) = 1/3
matching 1s
, Purchase transactions (just because two people didn't buy the same product doesn'tmean they
are similar)
distance metrics non counted zero numbers - Answers Numeric vectors where matching zeros
don't count
• Cosine similarity(v1,v2) = v1 dot_product v2 /norm(v1)*norm(v2)
• Cosine similarity((3,2,0,5),(1,0,0,0)) =
(3*1+2*0+0*0+5*0)/sqrt(3^2+2^2+0^2+5^2)*sqrt(1^2+0^2+0^2+0^2)
Document similarity (just because two documents don't include the same word doesn't mean
they are similar)
• Again, in practice, document term vectors are very sparse
K means Clustering method - Answers -k : pre-determined number of clusters
-Algorithm (Step 0: determine value of k)
Step 1: Randomly generate k random points as initial cluster centers.
Step 2: Assign each point to the nearest cluster center.
Step 3: Re-compute the new cluster centers.
Repetition step: Repeat steps 3 and 4 until some convergence criterion is met (usually that the
assignment of points to clusters becomes stable).
k-means clustering - Answers K-means is a randomized algorithm
• Makes random choices in the initial assignment of cluster means
• Consequence: run k-means multiple times on the same input, may get different output
• K-means is a greedy heuristic
• Returns local optima (not global optima)
• How to choose a good value of k?
• May have to try several values and inspect the clusters