You are on page 1of 30

Arab Academy for Science &Technology

& Maritime Transport

College of Computing and Information Technology

Data Mining
Lecturer: Prof. Osama Mohamed Badawy
Eng. Fatma Nagy
Agenda

1. Association Rules
2. Clustering (K_means)
3. Classification (Decision Tree)

2 April 28, 2023


Association Rules

• Support : No of Tuples (transactions) containing


specific value / total no. of Tuples

• Confidence (A => B): No of Tuples (transactions)


containing A and B / No. of Tuples containing A

3
Example

4
Solution

5
L2

6
Final Answer

7
K_Means

Calculating Distance

8
Example

9
Initial Centers

10
11
12
13
14
15
16
Decision Tree

17
1. Size

18
19
2. Shape

20
21
3. Color

22
23
24
25
26
27
28
Confusion Matrix
PREDICTED CLASS
Class=Yes Class=No
ACTUAL
CLASS
Class=Yes a (TP) b (FN)
Class=No c (FP) d (TN)

a 𝑎+𝑑
Precision (p) = Accuracy =
a+c 𝑎+𝑏+𝑐+𝑑
a
Recall (r) = 𝑇𝑃 + 𝑇𝑁
a+b =
2 rp 2a 𝑇𝑃 + 𝑇𝑁 + 𝐹𝑃 + 𝐹𝑁
F - measure (F) = =
r + p 2a + b + c
29
‫ث‬Example

Accuracy = (TP + TN)/All = (6954 + 2588)/10000 = 0.95


Precision = (TP )/ (TP+ FP) = 6954/(7366) = 0.94
Recall = TP/(TP+ FN)= 6954/7000 = 0.99
F - measure = 2a/ (2a + b + c) = 2*6954 / (2*6954 + 46 + 412) = 0.968

30

You might also like