Data Mining - Association Rule
Data Mining - Association Rule
Association Rule
Taryana, Sudimanto, Meylina
Dosen
Dr. Sani Susanto
I.
Latihan
Kita mengambil sebuah data transaksi pada penjualan sayur di tepi jalan
dengan data transaksi sebagai berikut:
Transaksi
1
2
3
4
5
6
7
8
9
10
11
12
13
14
Jawab.
1. Pisahkan masing-masing item yang dibeli.
Item yang dibeli
Asparagus
Beans
Broccoli
Corn
Green Peppers
Squash
Tomatoes
2. Kemudian buat tabel seperti di bawah ini
Transaksi
Asparagus
Beans
Broccoli
Corns
Green Peppers
Squash
Tomatoes
Aspara
gus
0
1
0
0
1
1
0
0
Beans
0
0
1
1
1
1
0
0
Broccoli
1
0
0
0
1
0
0
1
Corns
1
1
1
1
0
0
1
0
Green
Peppers
1
0
0
1
0
0
0
1
Squash
0
1
1
0
0
1
0
0
Tomatoe
s
0
0
1
1
0
1
1
1
9
10
11
12
13
14
1
0
0
1
1
0
1
1
1
1
1
1
0
0
1
0
0
1
0
1
0
0
1
1
0
0
1
0
0
1
1
0
1
1
1
0
0
0
0
0
0
1
Asp
arag
us
0
1
0
0
1
1
0
0
1
0
0
1
1
0
6
Beans
0
0
1
1
1
1
0
0
1
1
1
1
1
1
10
Broccoli
1
0
0
0
1
0
0
1
0
0
1
0
0
1
5
Corn
1
1
1
1
0
0
1
0
0
1
0
0
1
1
8
Green
Peppers
1
0
0
1
0
0
0
1
0
0
1
0
0
1
5
Squash
0
1
1
0
0
1
0
0
1
0
1
1
1
0
7
Tomatoe
s
0
0
1
1
0
1
1
1
0
0
0
0
0
1
6
Dari tabel diatas dapat diketahui total untuk tiap item yang terjadi ditiap
transaksi
Untuk k = 1, jika di lihat dari tabel, semua item jumlah Frekuensi item set nya
lebih besar dari maka:
F1 = {{Asparagus}, {Beans}, {Broccoli}, {Corn}, {Green Peppers}, {Squash},
{tomatoes}}
Untuk k = 2, diperlukan tabel untuk tiap pasang item sehingga didapat tabeltabel pasangan untuk masing-masing item seperti di bawah ini:
14
0
1
S
Untuk Asparagus dan Beans
5
Transaksi Asparagus Beans f
1
2
3
4
5
6
7
8
9
10
11
12
13
0
1
0
0
1
1
0
0
1
0
0
1
1
0
0
1
1
1
1
0
0
1
1
1
1
1
S
S
S
S
P
P
S
S
P
S
S
P
P
Transaksi
1
2
3
4
5
6
7
8
9
10
Asparagus
0
1
0
0
1
1
0
0
1
0
Broccoli
1
0
0
0
1
0
0
1
0
0
f
S
S
S
S
P
S
S
S
S
S
11
12
13
0
1
1
1
0
0
S
S
S
Asparagus
0
1
0
0
1
1
0
0
1
0
0
1
1
0
Corns
1
1
1
1
0
0
1
0
0
1
0
0
1
1
F
S
P
S
S
S
S
S
S
S
S
S
S
P
S
2
S
1
Transaksi
1
2
3
4
5
6
7
8
9
10
11
12
13
14
14
Untuk Asparagus
Peppers
Transaks
i
1
2
3
4
5
6
7
8
9
10
11
12
13
14
Asparagu
s
0
1
0
0
1
1
0
0
1
0
0
1
1
0
dan
Green
Green
Peppers
1
0
0
1
0
0
0
1
0
0
1
0
0
1
f
S
S
S
S
S
S
S
S
S
S
S
S
S
S
0
Transaksi
1
2
3
4
5
6
7
8
9
10
11
12
13
14
Asparagus
0
1
0
0
1
1
0
0
1
0
0
1
1
0
Squash
0
1
1
0
0
1
0
0
1
0
1
1
1
0
Transaksi
1
2
3
Beans
0
0
1
Broccoli
1
0
0
f
S
S
S
f
S
P
S
S
S
P
S
S
P
S
S
P
P
S
5
Transaksi
1
2
3
4
5
6
7
8
9
10
11
12
13
14
Asparagus
0
1
0
0
1
1
0
0
1
0
0
1
1
0
Tomatoes
0
0
1
1
0
1
1
1
0
0
0
0
0
1
4
5
6
7
8
1
1
1
0
0
0
1
0
0
1
f
S
S
S
S
S
P
S
S
S
S
S
S
S
S
1
S
P
S
S
S
9
10
11
12
13
14
1
1
1
1
1
1
0
0
1
0
0
1
Transaksi
1
2
3
4
5
6
7
8
9
10
11
12
13
14
S
S
P
S
S
P
3
Beans
0
0
1
Corns
1
1
1
f
S
S
P
Beans
0
0
1
1
1
1
0
0
1
1
1
1
1
1
Green Peppers
1
0
0
1
0
0
0
1
0
0
1
0
0
1
f
S
S
S
P
S
S
S
S
S
S
P
S
S
P
3
Beans
0
0
1
1
1
1
0
0
Tomatoes
0
0
1
1
0
1
1
1
P
S
S
S
S
S
P
S
S
P
P
5
f
S
S
P
P
S
P
S
S
Transaksi
1
2
3
4
5
6
7
8
9
10
11
12
13
14
Beans
0
0
1
1
1
1
0
0
1
1
1
1
1
1
Squash
0
1
1
0
0
1
0
0
1
0
1
1
1
0
Transaksi
1
2
3
4
5
6
7
8
1
0
0
1
0
0
1
0
0
1
1
Transaksi
1
2
3
4
5
6
7
8
9
10
11
12
13
14
1
1
1
0
0
1
1
1
1
1
1
9
10
11
12
13
14
1
1
1
1
1
1
f
S
S
P
S
S
P
S
S
P
S
P
P
P
S
6
0
0
0
0
0
1
S
S
S
S
S
P
4
Transaksi
Broccoli
Corns
1
2
3
4
5
6
7
8
9
1
0
0
0
1
0
0
1
0
1
1
1
1
0
0
1
0
0
P
S
S
S
S
S
S
S
S
10
11
12
13
14
Broccol
i
1
0
0
0
1
0
0
1
0
0
1
0
0
1
Green
Peppers
1
0
0
1
0
0
0
1
0
0
1
0
0
1
Transaksi
1
2
3
4
5
6
7
8
9
10
11
12
13
Broccoli
1
0
0
0
1
0
0
1
0
0
1
0
0
Squash
0
1
1
0
0
1
0
0
1
0
1
1
1
1
0
0
1
1
S
S
S
S
P
2
0
1
0
0
1
f
S
S
S
S
S
S
S
S
S
S
P
S
S
14
f
P
S
S
S
S
S
S
P
S
S
P
S
S
P
4
S
1
Transaksi
1
2
3
4
5
6
7
8
9
10
11
12
13
14
Broccoli
1
0
0
0
1
0
0
1
0
0
1
0
0
1
Tomatoes
0
0
1
1
0
1
1
1
0
0
0
0
0
1
f
S
S
S
S
S
S
S
P
S
S
S
S
S
P
2
Transaksi
1
2
3
4
5
6
7
8
9
Corns
1
1
1
1
0
0
1
0
0
Green Peppers
1
0
0
1
0
0
0
1
0
f
P
S
S
P
S
S
S
S
S
10
11
12
13
1
0
0
1
0
1
0
0
S
S
S
S
14
P
3
11
12
13
14
0
0
1
1
1
1
1
0
S
S
P
S
3
Transaksi
1
2
3
4
5
6
7
8
9
10
Corns
1
1
1
1
0
0
1
0
0
1
Squash
0
1
1
0
0
1
0
0
1
0
f
S
2
P
S
S
S
S
S
S
S
Green Peppers
1
0
0
1
0
0
0
1
0
0
1
0
0
1
Corns
1
1
1
1
0
0
1
0
0
1
0
0
1
1
Tomatoes
0
0
1
1
0
1
1
1
0
0
0
0
0
1
Transaksi
1
2
3
4
5
6
7
8
9
10
11
12
13
14
Transaksi
1
2
3
4
5
6
7
8
9
10
11
12
13
14
Squash
0
1
1
0
0
1
0
0
1
0
1
1
1
0
f
S
S
S
S
S
S
S
S
S
S
P
S
S
S
1
Untuk
Green
Tomatoes
Transak
si
1
2
3
4
5
6
7
8
9
10
11
12
13
14
Green
Peppers
1
0
0
1
0
0
0
1
0
0
1
0
0
1
f
S
S
P
P
S
S
P
S
S
S
S
S
S
P
4
Peppers
Tomatoe
s
0
0
1
1
0
1
1
1
0
0
0
0
0
1
dan
f
S
S
S
P
S
S
S
P
S
S
S
S
S
S
2
Transaksi
1
2
3
4
5
6
7
8
9
10
11
12
13
14
Squash
0
1
1
0
0
1
0
0
1
0
1
1
1
0
Tomatoes
0
0
1
1
0
1
1
1
0
0
0
0
0
1
f
S
S
P
S
S
P
S
S
S
S
S
S
S
S
2
Lihat pada tabel-tabel untuk suatu himpunan yang bersifat 2 unsur. P artinya itemitem di jual secara bersama-sama, sedangkan S artinya tidak ada item-item yang di
jual secara bersama-sama atau tidak terjadi transaksi
Kolom yang bewarna biru menandakan jumlah banyaknya P.
melambangkan Jumlah Frekuensi item set. Jumlah Frekuensi item set harus lebih
besar dari Frekuen iem set ( >= ), maka di dapat:
F2 = {{Asparagus, Beans}, {Asparagus, Squash}, {Beans, Corn}, {Beans, Squash},
{Beans, Tomatoes}, {Broccoli, Green Peppers}, {Corn, Tomatoes}}
Untuk k = 3, diperlukan tabel untuk tiap pasang item sehingga didapat tabel-tabel
pasangan untuk masing-masing item seperti di bawah ini:
Transaksi
1
2
3
4
Asparagus
0
1
0
0
Beans
0
0
1
1
Brocolli
1
0
0
0
f
S
S
S
S
5
6
7
8
9
10
11
12
13
14
1
1
0
0
1
1
1
1
1
1
1
0
0
1
0
0
1
0
0
1
P
S
S
S
S
S
S
S
S
S
1
1
0
0
1
0
0
1
1
0
Asparagus
0
1
0
0
1
1
0
0
1
0
0
1
1
0
Beans
0
0
1
1
1
1
0
0
1
1
1
1
1
1
Corns
1
1
1
1
0
0
1
0
0
1
0
0
1
1
f
S
S
S
S
S
S
S
S
S
S
S
S
P
S
Transaksi
1
2
3
4
5
6
7
8
9
10
Asparagus
0
1
0
0
1
1
0
0
1
0
Beans
0
0
1
1
1
1
0
0
1
1
Green
Peppers
1
0
0
1
0
0
0
1
0
0
f
S
S
S
S
S
S
S
S
S
S
10
11
12
13
14
1
1
1
1
1
0
0
1
S
S
S
S
Transaksi
1
2
3
4
5
6
7
8
9
10
11
12
13
14
0
1
1
0
Asparagus
0
1
0
0
1
1
0
0
1
0
0
1
1
0
Beans
0
0
1
1
1
1
0
0
1
1
1
1
1
1
Squash
0
1
1
0
0
1
0
0
1
0
1
1
1
0
f
S
S
S
S
S
P
S
S
P
S
S
P
P
S
Asparagus
0
1
0
0
1
1
0
0
1
0
0
1
1
0
Beans
0
0
1
1
1
1
0
0
1
1
1
1
1
1
Tomatoes
0
0
1
1
0
1
1
1
0
0
0
0
0
1
f
S
S
S
S
S
P
S
S
S
S
S
S
S
S
11
Transaksi
1
2
3
4
5
6
7
8
9
10
11
12
13
14
Beans
0
0
1
1
1
1
0
0
1
1
1
1
1
1
Corns
1
1
1
1
0
0
1
0
0
1
0
0
1
1
f
S
S
S
S
S
S
S
S
S
S
S
S
S
P
Brocolli
1
0
0
0
1
0
0
1
0
0
1
0
0
1
Beans
0
0
1
1
1
1
0
0
1
1
1
1
1
1
Brocolli
1
0
0
0
1
0
0
1
0
0
1
0
0
1
Green
Peppers
1
0
0
1
0
0
0
1
0
0
1
0
0
1
f
S
S
S
S
S
S
S
S
S
S
P
S
S
P
Transaksi
1
2
3
4
Beans
0
0
1
1
Brocolli
1
0
0
0
Squash
0
1
1
0
f
S
S
S
S
12
5
6
7
8
9
10
11
12
13
14
1
0
0
1
0
0
1
0
0
1
0
1
0
0
1
0
1
1
1
0
S
S
S
S
S
S
P
S
S
S
1
1
0
0
1
1
1
1
1
1
Beans
0
0
1
1
1
1
0
0
1
1
1
1
1
1
Brocolli
1
0
0
0
1
0
0
1
0
0
1
0
0
1
Tomatoes
0
0
1
1
0
1
1
1
0
0
0
0
0
1
f
S
S
S
S
S
S
S
S
S
S
S
S
S
P
Transaksi
1
2
3
4
5
6
7
8
9
10
Brocolli
1
0
0
0
1
0
0
1
0
0
Corns
1
1
1
1
0
0
1
0
0
1
Green
Peppers
1
0
0
1
0
0
0
1
0
0
f
P
S
S
S
S
S
S
S
S
S
13
11
12
13
14
0
0
1
1
1
0
0
1
S
S
S
P
1
0
0
1
Brocolli
1
0
0
0
1
0
0
1
0
0
1
0
0
1
Corns
1
1
1
1
0
0
1
0
0
1
0
0
1
1
Squash
0
1
1
0
0
1
0
0
1
0
1
1
1
0
f
S
S
S
S
S
S
S
S
S
S
S
S
S
S
Transaksi
1
2
3
4
5
6
7
8
9
10
11
12
13
14
Brocolli
1
0
0
0
1
0
0
1
0
0
1
0
0
1
Corns
1
1
1
1
0
0
1
0
0
1
0
0
1
1
Tomatoes
0
0
1
1
0
1
1
1
0
0
0
0
0
1
f
S
S
S
S
S
S
S
S
S
S
S
S
S
P
14
Transaksi
1
2
3
4
5
6
7
8
9
10
11
12
13
14
Green
Peppers
1
0
0
1
0
0
0
1
0
0
1
0
0
1
Corns
1
1
1
1
0
0
1
0
0
1
0
0
1
1
Squash
0
1
1
0
0
1
0
0
1
0
1
1
1
0
f
S
S
S
S
S
S
S
S
S
S
S
S
S
S
Corns
1
1
1
1
0
0
1
0
0
1
0
0
1
1
Green Peppers
1
0
0
1
0
0
0
1
0
0
1
0
0
1
Tomatoes
0
0
1
1
0
1
1
1
0
0
0
0
0
1
f
S
S
S
P
S
S
S
S
S
S
S
S
S
P
15
Transaksi
1
2
3
4
5
6
7
8
9
10
11
12
13
14
Green
Peppers
1
0
0
1
0
0
0
1
0
0
1
0
0
1
Squash
0
1
1
0
0
1
0
0
1
0
1
1
1
0
Tomatoes
0
0
1
1
0
1
1
1
0
0
0
0
0
1
f
S
S
S
S
S
S
S
S
S
S
S
S
S
S
Lihat pada tabel-tabel untuk suatu himpunan yang bersifat 3 unsur. P artinya itemitem di jual secara bersama-sama, sedangkan S artinya tidak ada item-item yang di
jual secara bersama-sama atau tidak terjadi transaksi
Kolom yang bewarna biru menandakan jumlah banyaknya P.
melambangkan Jumlah Frekuensi item set. Jumlah Frekuensi item set harus lebih
besar dari Frekuen iem set ( >= ), maka di dapat:
F3 = {{Asparagus, Beans, Squash}}
Untuk k = 4, diperlukan tabel untuk tiap pasang item sehingga didapat tabel-tabel
pasangan untuk masing-masing item seperti di bawah ini:
Transaksi
1
2
3
4
5
6
7
Asparagus
0
1
0
0
1
1
0
Beans
0
0
1
1
1
1
0
Brocolli
1
0
0
0
1
0
0
Corns
1
1
1
1
0
0
1
f
S
S
S
S
S
S
S
16
8
9
10
11
12
13
14
0
1
0
0
1
1
0
0
1
1
1
1
1
1
1
0
0
1
0
0
1
0
0
1
0
0
1
1
Transaksi
1
2
3
4
5
6
7
8
9
10
11
12
13
14
S
S
S
S
S
S
S
0
Asparagus
0
1
0
0
1
1
0
0
1
0
0
1
1
0
Beans
0
0
1
1
1
1
0
0
1
1
1
1
1
1
Brocolli
1
0
0
0
1
0
0
1
0
0
1
0
0
1
Green
Peppers
1
0
0
1
0
0
0
1
0
0
1
0
0
1
f
S
S
S
S
S
S
S
S
S
S
S
S
S
S
0
Squash
0
1
1
0
0
1
0
0
1
0
1
1
1
f
S
S
S
S
S
S
S
S
S
S
S
S
S
Transaksi
1
2
3
4
5
6
7
8
9
10
11
12
13
Asparagus
0
1
0
0
1
1
0
0
1
0
0
1
1
Beans
0
0
1
1
1
1
0
0
1
1
1
1
1
Brocolli
1
0
0
0
1
0
0
1
0
0
1
0
0
17
14
Transaksi
1
2
3
4
5
6
7
8
9
10
11
12
13
14
Asparagus
0
1
0
0
1
1
0
0
1
0
0
1
1
0
Beans
0
0
1
1
1
1
0
0
1
1
1
1
1
1
Brocolli
1
0
0
0
1
0
0
1
0
0
1
0
0
1
Tomatoes
0
0
1
1
0
1
1
1
0
0
0
0
0
1
f
S
S
S
S
S
S
S
S
S
S
S
S
S
S
0
Transaksi
1
2
3
4
5
6
7
8
9
10
11
12
13
14
S
0
Beans
0
0
1
1
1
1
0
0
1
1
1
1
1
1
Brocolli
1
0
0
0
1
0
0
1
0
0
1
0
0
1
Corns
1
1
1
1
0
0
1
0
0
1
0
0
1
1
Green
Peppers
1
0
0
1
0
0
0
1
0
0
1
0
0
1
f
S
S
S
S
S
S
S
S
S
S
S
S
S
P
1
Squash
0
f
S
Transaksi
1
Beans
0
Brocolli
1
Corns
1
18
2
3
4
5
6
7
8
9
10
11
12
13
14
0
1
1
1
1
0
0
1
1
1
1
1
1
0
0
0
1
0
0
1
0
0
1
0
0
1
1
1
1
0
0
1
0
0
1
0
0
1
1
1
1
0
0
1
0
0
1
0
1
1
1
0
Transaksi
1
2
3
4
5
6
7
8
9
10
11
12
13
14
S
S
S
S
S
S
S
S
S
S
S
S
S
0
Beans
0
0
1
1
1
1
0
0
1
1
1
1
1
1
Brocolli
1
0
0
0
1
0
0
1
0
0
1
0
0
1
Corns
1
1
1
1
0
0
1
0
0
1
0
0
1
1
Tomatoes
0
0
1
1
0
1
1
1
0
0
0
0
0
1
f
S
S
S
S
S
S
S
S
S
S
S
S
S
P
1
Squash
0
1
1
0
0
1
f
S
S
S
S
S
S
Transaksi
1
2
3
4
5
6
Brocolli
1
0
0
0
1
0
Corns
1
1
1
1
0
0
Green
Peppers
1
0
0
1
0
0
19
7
8
9
10
11
12
13
14
0
1
0
0
1
0
0
1
1
0
0
1
0
0
1
1
0
1
0
0
1
0
0
1
0
0
1
0
1
1
1
0
Transaksi
1
2
3
4
5
6
7
8
9
10
11
12
13
14
S
S
S
S
S
S
S
S
0
Brocolli
1
0
0
0
1
0
0
1
0
0
1
0
0
1
Corns
1
1
1
1
0
0
1
0
0
1
0
0
1
1
Green
Peppers
1
0
0
1
0
0
0
1
0
0
1
0
0
1
Tomatoes
0
0
1
1
0
1
1
1
0
0
0
0
0
1
f
S
S
S
S
S
S
S
S
S
S
S
S
S
P
1
Tomatoes
0
0
1
1
0
1
1
1
0
0
0
0
0
f
S
S
S
S
S
S
S
S
S
S
S
S
S
Transaksi
1
2
3
4
5
6
7
8
9
10
11
12
13
Corns
1
1
1
1
0
0
1
0
0
1
0
0
1
Green
Peppers
1
0
0
1
0
0
0
1
0
0
1
0
0
Squash
0
1
1
0
0
1
0
0
1
0
1
1
1
20
14
S
0
Lihat pada tabel-tabel untuk suatu himpunan yang bersifat 4 unsur. P artinya itemitem di jual secara bersama-sama, sedangkan S artinya tidak ada item-item yang di
jual secara bersama-sama atau tidak terjadi transaksi
Kolom yang bewarna biru menandakan jumlah banyaknya P.
melambangkan Jumlah Frekuensi item set. Jumlah Frekuensi item set harus lebih
besar dari Frekuen iem set ( >= ), maka F4 adalah himpunan kosong ( {} ).
Karena F4 adalah himpunan kosong maka F5 , F6 , F7 , adalah Himpunan Kosong.
5. Rule yang dipakai adalah If x Then y, dimana x adalah Antecedent dan y
adalah Consequent. Berdasarkan rule diatas maka di perlukan 2 buah item
yang mana salah satunya sebagai Antecedent dan sisanya sebagai Consequent.
Sehingga dari langkah 4 di dapat 2 buah Fk yaitu F2 dan F3 . Mengapa F1
tidak disertakan? Karena F1 hanya terdiri 1 unsur item saja. Untuk Antecedent
boleh terdiri dari lebih 1 unsur sedangkan untuk Consequent lebih mudah
terdiri dari 1 unsur di banding 2 unsur atau lebih.
6. Tentukan (ss-s) sebagai Antecedent dan s sebagai Consequent dari Fk yang
telah di dapat berdasarkan rule pada langkah 5.
Untuk F2 Himpunan yang didapat adalah sebagai berikut:
F2 = {{Asparagus, Beans}, {Asparagus, Squash}, {Beans, Corn}, {Beans,
Squash}, {Beans, Tomatoes}, {Broccoli, Green Peppers}, {Corn, Tomatoes}}
Maka dapat di susun:
Untuk {Asparagus, Beans}
- Jika (ss-s) = Asparagus
Jika s = Beans
Maka => If Buy Asparagus then Buy Beans
- Jika (ss-s) = Beans
Jika s = Asparagus
Maka => If Buy Beans then Buy Asparagus
Untuk {Asparagus, Squash}
- Jika (ss-s) = Asparagus
Jika s = Squash
Maka => If Buy Asparagus then Buy Squash
- Jika (ss-s) = Squash
Jika s = Asparagus
Maka => If Buy Squash then Buy Asparagus
Untuk {Beans, Corn}
- Jika (ss-s) = Beans
Jika s = Corn
Maka => If Buy Beans then Buy Corn
- Jika (ss-s) = Corn
Jika s = Beans
Maka => If Buy Corn then Buy Beans
Untuk {Beans,Squash}
21
22
8. Dari langkah 7 kita dapat membagi 2 bagian yaitu dengan 2 Antecedent dan
dengan 1 Antecedent, yang kemudian dicari Support dan Confidence. Cara
mencari Support dan Confidence akan di bahas nanti.
Tabel kandidat Asosiasi Rule untuk 2 Antecedent
If Antecedent Then Concequent
Support
Confidence
If Buy Asparagus and Beans then Buy Squash
If Buy Asparagus and Squash then Buy Beans
If Buy Beans and Squash then Buy Asparagus
Support
Confidence
Support =
X 100%
Untuk Item yang dibeli sekaligus contohnya pada tabel 3 unsur untuk
{Asparagus, Beans dan Squash}, ada 4 dari 14 transaksi sehingga untuk
4
Support nya adalah
X 100% = 28.6%
14
Untuk Confidence
Confidence= _____
X 100%
Untuk Item yang dibeli sekaligus contohnya pada tabel 3 unsur untuk
{Asparagus, Beans dan Squash}, ada 4 sedangkan yang membeli
Asparagus dan Beans ada 5 orang (lihat Tabel 2 unsur untuk {Asparagus
dan Beans}) sehingga untuk
4
X 100% = 80%
Confident nya adalah
5
10. Setelah didapat Support dan Conident untuk masing-masing kandidat, lakukan
perkalian antara Support dan Confidence sehingga didapat seperti Tabel di
bawah ini:
Tabel Support dan Confident untuk 2 Antecedent
If Antecedent then Consequent
Support
Confidence
4/14 = 28.6%
4/5 = 80%
If Buy Asparagus and Beans then Buy Squash
4/14 = 28.6%
4/5 = 80%
If Buy Asparagus and Squash then Buy Beans
4/14
=
28.6%
4/6 = 66.7%
If Buy Beans and Squash then Buy Asparagus
Confidence
5/6 = 83.3%
5/10 = 50%
5/6 = 83.3%
5/7 = 71.4%
5/10 = 50%
5/8 = 62.5%
6/10 = 60%
6/7 = 85.7%
4/10 = 40%
4/6 = 66.7%
4/5 = 80%
4/5 = 80%
4/8 = 50%
4/6 = 66.7%
24
Dari sekian banyak rule yang di dapat, lakukan perkalian antara Support dengan
Confidence, yang mana Confidence yang di ambil sekitar 80% keatas sebagai
contoh. Seperti tabel di bawah ini
If Antecedent then Consequent
Support
Confidence Support x
Confidenc
e
0.3667
If Buy Asparagus and Beans then Buy 4/14 = 28.6% 4/5 = 80%
Squash
0.2974
If Buy Asparagus and Squash then 4/14 = 28.6% 4/5 = 80%
Buy Beans
5/14 = 35.7% 5/6 = 83.3% 0.2974
If Buy Asparagus then Buy Beans
5/14 = 35.7% 5/6 = 83.3% 0.2288
If Buy Asparagus then Buy Squash
6/14 = 42.9% 6/7 = 85.7% 0.2288
If Buy Squash then Buy Beans
0.2288
If Buy Broccoli then Buy Green 4/14 = 28.6% 4/5 = 80%
Peppers
If Buy Green Peppers then Buy
4/14 = 28.6% 4/5 = 80%
0.2288
Broccoli
11. Setelah didapat hasil perkalian antara Support dan Confidence pilihlah yang
hasil perkaliannya paling besar. Hasil paling besar dari perkalian perkalian
tersebut merupakan rule yang di pakai pada saat menjual sayur (dalam contoh),
yang artinya adalah jika ada yang membeli Asparagus dan Beans maka
membeli Squash.
25