Slamat siang sahabat Blogger... siang ini saya akan bagikan tugas kuliah saya tentang Data mining Dan Data Warehouse... semoga bisa membantu teman-teman.. download file wordnya disini tugas data mining dan data warehouse
Transaksi
|
Item
yang di beli
|
1
|
Broccoli,
Green Peppers, Corn
|
2
|
Asparagus,
Squash, Corn
|
3
|
Corn,
Tomatoes, Beans, Squash
|
4
|
Green
Peppers, corns, Tomatoes, Beans
|
5
|
Beans,
Asparagus, Broccoli
|
6
|
Squash,
Asparagus, Beans, Tomatoes
|
7
|
Tomatoes,
Corn
|
8
|
Broccoli,
Tomatoes, Green Peppers
|
9
|
Squash,
Asparagus, Beans
|
10
|
Beans,
Corn
|
11
|
Green
Peppers, Broccoli, Beans, Squash
|
12
|
Asparagus,
Beans, Squash
|
13
|
Squash,
Corn, Asparagus, Beans
|
14
|
Corn,
Green Peppers, Tomatoes, Beans, Broccoli
|
A. Berikut
masing-masing item yang dibeli :
1. Asparagus
2. Beans
3. Broccoli
4. Corn
5. Green
Peppers
6. Squash
7. Tomatoes
B. Tabel
Transaksi
|
Asparagus
|
Beans
|
Broccoli
|
Corn
|
Green
Peppers
|
squash
|
tomatoes
|
1
|
0
|
0
|
1
|
1
|
1
|
0
|
0
|
2
|
1
|
0
|
0
|
1
|
0
|
1
|
0
|
3
|
0
|
1
|
0
|
1
|
0
|
1
|
1
|
4
|
0
|
1
|
0
|
1
|
1
|
0
|
1
|
5
|
1
|
1
|
1
|
0
|
0
|
0
|
0
|
6
|
1
|
1
|
0
|
0
|
0
|
1
|
1
|
7
|
0
|
0
|
0
|
1
|
0
|
0
|
1
|
8
|
0
|
0
|
1
|
0
|
1
|
0
|
1
|
9
|
1
|
1
|
0
|
0
|
0
|
1
|
0
|
10
|
0
|
1
|
0
|
1
|
0
|
0
|
0
|
11
|
0
|
1
|
1
|
0
|
1
|
1
|
0
|
12
|
1
|
1
|
0
|
0
|
0
|
1
|
0
|
13
|
1
|
1
|
0
|
1
|
0
|
1
|
0
|
14
|
0
|
1
|
1
|
1
|
1
|
0
|
1
|
∑
|
6
|
10
|
5
|
8
|
5
|
7
|
6
|
C. Tentukan
Ф.
Misalkan kita tentukan Ф = 3, maka kita
dapat menentukan frekuen itemset. Dari tabel di atas diketahui total Ф untuk
transaksi k = 1, semuanya lebih besar dari Ф. Maka:
Untuk k = 2 (2 unsur), diperlukan
tabel untuk tiap-tiap pasang item. Himpunan yang mungkin terbentuk adalah: {Asparagus,
Beans}, {Asparagus, Broccoli}, {Asparagus, Corn}, {Asparagus, Green Peppers}, {Asparagus,
Squash}, {Asparagus, Tomatoes}, {Beans, Broccoli}, {Beans, Corn}, {Beans, Green
Peppers}, {Beans, Squash}, {Beans, Tomatoes}, {Broccoli, Corn}, {Broccoli, Green
Peppers}, {Broccoli, Squash}, { Broccoli, Tomatoes}, {Corn, Green Peppers},
{Corn, Squash}, {Corn, Tomatoes}, {Green Peppers, Squash}, {Green Peppers, Tomatoes},
{Squash, Tomatoes}
T
|
Asparagus
|
Beans
|
f
|
1
|
0
|
0
|
S
|
2
|
1
|
0
|
S
|
3
|
0
|
1
|
S
|
4
|
0
|
1
|
S
|
5
|
1
|
1
|
P
|
6
|
1
|
1
|
P
|
7
|
0
|
0
|
S
|
8
|
0
|
0
|
S
|
9
|
1
|
1
|
P
|
10
|
0
|
1
|
S
|
11
|
0
|
1
|
S
|
12
|
1
|
1
|
P
|
13
|
1
|
1
|
P
|
14
|
0
|
1
|
S
|
∑
|
5
|
||
T
|
Asparagus
|
Broccoli
|
f
|
1
|
0
|
1
|
S
|
2
|
1
|
0
|
S
|
3
|
0
|
0
|
S
|
4
|
0
|
0
|
S
|
5
|
1
|
1
|
P
|
6
|
1
|
0
|
S
|
7
|
0
|
0
|
S
|
8
|
0
|
1
|
S
|
9
|
1
|
0
|
S
|
10
|
0
|
0
|
S
|
11
|
0
|
1
|
S
|
12
|
1
|
0
|
S
|
13
|
1
|
0
|
S
|
14
|
0
|
1
|
S
|
∑
|
1
|
||
T
|
Asparagus
|
Corn
|
f
|
1
|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sur di atas, P artinya item-item yang dijual bersamaan,
sedangkan S berarti tidak ada item yang dijual bersamaan atau tidak terjadi
transaksi. Σ melambangkan jumlah Frekuensi item set. Jumlah frekuensi item set
harus lebih besar atau sama dengan jumlah Frekuensi item set (Σ >= Ф). Dari
tabel diatas, maka didapat :
kombinasi
dari itemset dalam F2, dapat kita gabungkan menjadi calon 3-itemset.
Itemset-itemset yang dapat digabungkan adalah itemset-itemset yang memiliki
kesamaan dalam k-1 item pertama. Misalnya {Asparagus, Beans}
dan {Asparagus,
Squash} memiliki itemset k-1 pertama yg sama,
yaitu Asparagus,
maka dapat digabungkan menjadi 3-itemset baru yaitu { Asparagus, Beans,
Squash}. Untuk k = 3 (3 unsur), himpunan yang
mungkin terbentuk adalah: {Asparagus, Beans, Squash},
{asparagus ,beans, broccoli},
{asparagus, beans, corns}, {asparagus, beans, green peppers}, {asparagus, beans, tomatoes}, {asparagus, corn, Squash}, {beans,
broccoli, corn}, {beans, broccoli, green peppers}, { beans, broccoli, squash}, {beans, broccoli,
tomatoes}, {beans, corn, green peppers}, {beans, corn, squash}, {beans, green
peppers, tomatoes}, {beans, corn, tomatoes}, {broccoli, corn, green peppers}, {broccoli,
green peppers, tomatoes}, {corn, green peppers, squash}, {corn, green peppers, tomatoes},
{corn, squash, tomatoes}.
T
|
Asparagus
|
Beans
|
Squash
|
f
|
1
|
0
|
0
|
0
|
S
|
2
|
1
|
0
|
1
|
S
|
3
|
0
|
1
|
1
|
S
|
4
|
0
|
1
|
0
|
S
|
5
|
1
|
1
|
0
|
S
|
6
|
1
|
1
|
1
|
P
|
7
|
0
|
0
|
0
|
S
|
8
|
0
|
0
|
0
|
S
|
9
|
1
|
1
|
1
|
P
|
10
|
0
|
1
|
0
|
S
|
11
|
0
|
1
|
1
|
S
|
12
|
1
|
1
|
1
|
P
|
13
|
1
|
1
|
1
|
P
|
14
|
0
|
1
|
0
|
S
|
∑
|
4
|
|||
T
|
Asparagus
|
Beans
|
Broccoli
|
f
|
1
|
0
|
0
|
1
|
S
|
2
|
1
|
0
|
0
|
S
|
3
|
0
|
1
|
0
|
S
|
4
|
0
|
1
|
0
|
S
|
5
|
1
|
1
|
1
|
P
|
6
|
1
|
1
|
0
|
S
|
7
|
0
|
0
|
0
|
S
|
8
|
0
|
0
|
1
|
S
|
9
|
1
|
1
|
0
|
S
|
10
|
0
|
1
|
0
|
S
|
11
|
0
|
1
|
1
|
S
|
12
|
1
|
1
|
0
|
S
|
13
|
1
|
1
|
0
|
S
|
14
|
0
|
1
|
1
|
P
|
∑
|
2
|
|||
Dari table-tabel
di atas, didapat
={{Asparagus,
Beans, Squash}, {beans, corn, tomatoes}}
Untuk k = 4 (4
unsur), himpunan yang mungkin terbentuk adalah: {Asparagus, Beans, Corn,
tomatoes}
T
|
Asparagus
|
Beans
|
Corn
|
Tomatoes
|
f
|
1
|
0
|
0
|
1
|
0
|
S
|
2
|
1
|
0
|
1
|
0
|
S
|
3
|
0
|
1
|
1
|
1
|
S
|
4
|
0
|
1
|
1
|
1
|
S
|
5
|
1
|
1
|
0
|
0
|
S
|
6
|
1
|
1
|
0
|
1
|
S
|
7
|
0
|
0
|
1
|
1
|
S
|
8
|
0
|
0
|
0
|
1
|
S
|
9
|
1
|
1
|
0
|
0
|
S
|
10
|
0
|
1
|
1
|
0
|
S
|
11
|
0
|
1
|
0
|
0
|
S
|
12
|
1
|
1
|
0
|
0
|
S
|
13
|
1
|
1
|
1
|
0
|
S
|
14
|
0
|
1
|
1
|
1
|
S
|
∑
|
0
|
||||
Dari Tabel di atas,
didapat F4= { }, karena tidak ada Σ >= Ф sehingga F5, F6 dan F7 juga merupakan
himpunan kosong.
A.
Tentukan (ss-s) sebagai
antecedent dan s sebagai consequent dari Fk yang telah didapat berdasarkan rule
pada bagian C.
Pada
, Didapat Himpunan
= {{Asparagus,
Beans, Squash}, { beans, corn, tomatoes}}
Pada
Maka dapat disusun :
Ø Untuk {Asparagus, Beans, ssquash}
:
·
Jika (ss-s) = Asparagus, Beans
jika s = squash Maka if buy
Asparagus, Beans then buy Squash
·
Jika (ss-s) = Asparagus, Squash
jika s =Beans Maka if buy Asparagus,
Squash then buy Beans
·
Jika (ss-s) = Beans, squash,
jika s = Asparagus Maka if buy Beans, squash then buy
Asparagus
Ø Untuk {Beans, Corn, Tomatoes} :
·
Jika (ss-s) = Beans, Corn jika
s = Tomatoes Maka if buy Beans, Corn then buy tomatoes
·
Jika (ss-s) = Beans, tomatoes
jika s = Corn maka if buy Beans, tomatoes then buy corn
·
Jika (ss-s) = Corn, tomatoes
jika s = Beans Maka if buy corn,
tomatoes then buy Beans
A.
Hitung Support dan Confidence
If antecedent then
consequent
|
Support
|
Confidence
|
if buy Asparagus, Beans
then buy Squash
|
(4/14)x100% = 28,57%
|
(4/5)x100% = 80%
|
if buy Asparagus, Squash then buy Beans
|
(4/14)x100% = 28,57%
|
(4/4)x100% = 100%
|
if buy Beans, squash
then buy Asparagus
|
(4/14)x100% = 28,57%
|
(4/6)x100% = 57,14%
|
if buy Beans, Corn}
then buy tomatoes
|
(3/14)x100% = 21,42%
|
(3/5)x100% = 60%
|
if buy Beans,
tomatoes then buy corn
|
(3/14)x100% = 21,42%
|
(3/4)x100% = 75%
|
if buy corn, tomatoes
then buy Beans
|
(3/14)x100% = 21,42%
|
(3/4)x100% = 75%
|
B.
Setelah dapat support dan
confidence untuk masing-masing kandidat, lakukan Perkalian antara support dan
confidence, dimana confidencenya diambil 80% keatas, sehingga di dapat table
sbb:
If antecedent then
consequent
|
Support
|
Confidence
|
Support x Confidence
|
if buy Asparagus, Beans
then buy Squash
|
28,57%
|
80%
|
2285,6
|
if buy Asparagus, Squash then buy Beans
|
28,57%
|
100%
|
2857
|
C.
Setelah didapat hasil perkalian
antara support dan confidence, pilihlah hasil perkaliannya paling besar. Hasil
paling besar dari perkalian tersebut merupakan rule yang dipakai pada saat
menjual.
Ø Jika membeli Asparagus,Squash maka akan membeli Beans dengan support
28,57% dan confidence 100%

0 komentar:
Post a Comment