Reasoning Artificial Intelegence
Reasoning Artificial Intelegence
e
=
lainnya. kasus untuk 0
; jika , 1
) (
A x
x
A
k
x
) (x
A
k
1
5 6 7 8 9
0
A
Fungsi Karakteristik Classical Set
A = himpunan klasik semua bilangan bulat positif lebih
dari 4 dan dan kurang dari 10 atau {5, 6, , 9}.
x
) (x
A
k
1
5 6 7 8 9
0
) (x
B
k
x
1
5 6 7 3 4
0
2
A B
x
) (x
B A
k
1
5 6 7
0 x
1
5 6 7 3 4
0
2
B A B A
8 9
) (
\
x
B A
k
x
1
0
B A\
8 9
) (x
B A
k
) ( x
A
k
x
1
0
A
4 10
A
I ntersection Union
Complement Difference
Kasus 1: Pemberian Beasiswa
Mahasiswa IPK Gaji Ortu (Rp/bulan)
A 3,00 10 juta
B 2,99 1 juta
Logika Biner (classical sets)
Beasiswa Dapat then
juta 10 and 00 , 3 if s > G IPK
A lebih layak mendapatkan beasiswa.
Kurang adil (manusiawi).
Fuzzy Sets
Digunakan untuk penalaran yang lebih manusiawi.
Misalkan U adalah universe of discourse (semesta
pembicaraan) dan x adalah anggota U.
Suatu fuzzy set A di dalam U didefinisikan sebagai
suatu membership function atau fungsi keanggotaan,
yang memetakan setiap objek di U menjadi suatu nilai
real dalam interval [0, 1].
Nilai-nilai menyatakan derajat keanggotaan x di
dalam A.
Suhu (
0
C) Dingin Hangat Panas
5 1 0,1 0
15 0,9 0,8 0
25 0,5 1 0,6
35 0,1 0,6 0,9
45 0 0,2 1
Fuzzy Set
Dingin = {5, 15, 25, 35} dan derajat keanggotaannya
dinyatakan oleh
Dingin
= {1; 0,9; 0,5; 0,1}
Hangat = {5, 15, 25, 35, 45} dan derajat keanggotaannya
dinyatakan oleh
Hangat
= {0,1; 0,8; 1; 0,6; 0,2}
Panas = {25, 35, 45} dan derajat keanggotaannya
dinyatakan oleh
Panas
= {0,6; 0,9; 1}
x
) (x
A
1
0
core
aaaaaaaa cut o
support
o
Fungsi keanggotaan
A
dengan core, cut o dan support
Bentuk Fungsi Keanggotaan
Fungsi Linier
Fungsi Sigmoid
Fungsi Segitiga
Fungsi Trapesium
Fungsi Berbentuk Bell:
Phi
Beta
Gauss
s <
s
=
b x a a b a x
a x
b a x
), /( ) (
, 0
) , , ( LinierNaik
a 0
1
) (x
b
x
>
< s
=
b x
b x a a b x b
b a x
, 0
), /( ) (
) , , ( n LinierTuru
a 0
1
) (x
b
x
s
< <
s <
s
=
x c
c x b a c x c
b x a a c a x
a x
c b a x
, 1
, )) /( ) (( 2 1
, )) /( ) (( 2
, 0
) , , , ( Sigmoid
2
2
a b 0
1
) (x
c
x
>
< <
s <
s
=
c x
c x b a c x c
b x a a c a x
a x
c b a x
, 0
, )) /( ) (( 2
, )) /( ) (( 2 1
, 1
) , , , ( Sigmoid
2
2
a b 0
1
) (x
c
x
0,5
0,5
x
s <
s <
> s
=
c x b b c c x
b x a a b a x
c x a x
c b a x
), /( ) (
), /( ) (
, , 0
) , , , ( Segitiga
a b c 0
1
) (x
x
s <
s s
< <
> s
=
d x c c d d x
c x b
b x a a b a x
d x a x
d c b a x
), /( ) (
, 1
), /( ) (
, , 0
) , , , , ( Trapesium
a b c d 0
1
) (x
x
) (x
A
1
0
) (x
B
x
1
0
A B
x
) (x
1
0 x
1
0
B A
x
1
0
) (x
x
1
0
A A
I ntersection Union
Complement Difference
2,5 7,5 6,5 9,5
6,5 7,5
B A
2,5 9,5 2,5 9,5
7,5 2,5
A
B A\
2,5 9,5
) (x ) (x
Fuzzy Set
x
) (x
A
k
1
5 6 7 8 9
0
) (x
B
k
x
1
5 6 7 3 4
0
2
A B
x
) (x
B A
k
1
5 6 7
0 x
1
5 6 7 3 4
0
2
B A B A
8 9
) (
\
x
B A
k
x
1
0
B A\
8 9
) (x
B A
k
) ( x
A
k
x
1
0
A
4 10
A
I ntersection Union
Complement Difference
Classical Set
Logical connectives & Implication
Dalam bahasa manusia, banyak percakapan yang
menggunakan kalimat yang tidak pasti kebenarannya
Hampir semua orang suka permen
Sepertinya dia anak yang pintar
Misalkan P adalah suatu fuzzy logic proposition
Nilai kebenaran P adalah [0, 1].
Nilai 0 menyatakan bahwa P adalah salah
Nilai 1 menyatakan bahwa P adalah benar
Logical connectives & Implication
T adalah fungsi kebenaran yang memetakan P ke suatu
nilai dalam interval [0, 1].
] 1 , 0 [ : P T
Logical Connectives
Negation
Disjunction
Conjunction
) ( 1 ) ( P T P T =
{ } ) ( ), ( max ) ( Q T P T Q P T = v
{ } ) ( ), ( min ) ( Q T P T Q P T = .
Approximate Reasoning
A : Apakah dia anak yang pintar?
B : Sepertinya begitu.
A : Apakah Indeks Prestasi dan hasil tes psikologinya bagus?
B : Ya, keduanya sangat bagus.
A : Apakah dia layak mendapatkan beasiswa?
B : Ya, sepertinya itu adalah keputusan yang baik.
Approximate Reasoning
membaca suka Dani Sepertinya :
mahasiswa adalah Dani :
membaca suka mahasiswa besar Sebagian :
3
2
1
P
P
P
Reasoning yang Pasti
mati akan pasti Dani :
manusia adalah Dani :
mati akan pasti manusia Semua :
3
2
1
P
P
P
Sistem Berbasis Aturan Fuzzy
Variabel linguistik adalah suatu interval numerik dan
mempunyai nilai-nilai linguistik, yang semantiknya
didefinisikan oleh fungsi keanggotaannya.
Misalnya, Suhu adalah suatu variabel linguistik yang
bisa didefinisikan pada interval [-10
0
C, 40
0
C].
Variabel tersebut bisa memiliki nilai-nilai linguistik
seperti Dingin, Hangat, Panas yang semantiknya
didefinisikan oleh fungsi-fungsi keanggotaan tertentu.
Fuzzification
Inference
Defuzzification
Fuzzy rules
Crisp input
Fuzzy input
Output Fuzzy output
Crisp value
Model Inferensi
Mamdani Intuitive
Sugeno Control
Masalah: Pemberian Beasiswa
Mahasiswa IPK Gaji Ortu (Rp/bulan)
A 3,00 10 juta
B 2,99 1 juta
FK untuk IPK
2,00 2,75 0
1
3,25
Buruk Cukup Bagus
4,00
IPK
IPK mahasiswa A
) /( ) ( ) ( a b a x x =
) /( ) ( ) ( b c c x x =
1 3 0
1
6
Kecil Sedang Besar
12
Gaji orangtua
(juta rupiah)
Sangat
Besar
4 7
FK Gaji Orangtua
Gaji Ortu mhs A
d x c c d d x x s < = ), /( ) ( ) (
b x a a b a x x < < = ), /( ) ( ) (
Fuzzification untuk mhs A
IPK = Cukup (0,5)
IPK = Bagus (0,5)
Gaji Orangtua = Besar (0,4)
Gaji Orangtua = Sangat Besar (0,6)
IPK = 3,00
Gaji Orangtua = 10 juta/bulan
Fungsi Keanggotaan Nilai Kelayakan
80
50 0
1
Rendah Tinggi
100
Nilai Kelayakan
skala [0, 100]
Aturan Fuzzy untuk Nilai Kelayakan
Buruk
Cukup
Bagus
Kecil Sedang Besar Sangat Besar
Rendah
IPK
Gaji
Tinggi
Tinggi
Tinggi
Rendah Rendah Rendah
Rendah
Rendah Tinggi
Rendah Rendah
Rendah THEN Besar Sangat AND Bagus IF 12.
Tinggi THEN Besar AND Bagus IF 11.
Tinggi THEN Sedang AND Bagus IF 10.
Tinggi THEN Kecil AND Bagus IF 9.
Rendah THEN Besar Sangat AND Cukup IF 8.
Rendah THEN Besar AND Cukup IF 7.
Rendah THEN Sedang AND Cukup IF 6.
Tinggi THEN Kecil AND Cukup IF 5.
Rendah THEN Besar Sangat AND Buruk IF . 4
Rendah THEN Besar AND Buruk IF . 3
Rendah THEN Sedang AND Buruk IF . 2
Rendah THEN Kecil AND Buruk IF . 1
= = =
= = =
= = =
= = =
= = =
= = =
= = =
= = =
= = =
= = =
= = =
= = =
NK Gaji IPK
NK Gaji IPK
NK Gaji IPK
NK Gaji IPK
NK Gaji IPK
NK Gaji IPK
NK Gaji IPK
NK Gaji IPK
NK Gaji IPK
NK Gaji IPK
NK Gaji IPK
NK Gaji IPK
Inferensi pada model Mamdani: Clipping dan Scaling
0 10 20 40 50
1
1/5
0 10 20 40 50
1
1/5
(a) Clipping
(b) Scaling
Aturan fuzzy yang diaplikasikan
Rendah THEN Besar Sangat AND Bagus IF 12.
Tinggi THEN Besar AND Bagus IF 11.
Rendah THEN Besar Sangat AND Cukup IF 8.
Rendah THEN Besar AND Cukup IF 7.
= = =
= = =
= = =
= = =
NK Gaji IPK
NK Gaji IPK
NK Gaji IPK
NK Gaji IPK
Nilai fuzzy untuk mhs A
IPK = Cukup (0,5)
IPK = Bagus (0,5)
Gaji Orangtua = Besar (0,4)
Gaji Orangtua = Sangat Besar (0,6)
IPK = 3,00
Gaji Orangtua = 10 juta/bulan
Conjunction (.) & Disjunction (v)
) Rendah(0,5 THEN Besar(0,6) Sangat AND Bagus(0,5) IF
) Tinggi(0,4 THEN Besar(0,4) AND Bagus(0,5) IF
) Rendah(0,5 THEN Besar(0,6) Sangat AND ) 5 , 0 ( Cukup IF
) Rendah(0,4 THEN Besar(0,4) AND Cukup(0,5) IF
= = =
= = =
= = =
= = =
NK Gaji IPK
NK Gaji IPK
NK Gaji IPK
NK Gaji IPK
NK = Rendah (0,5)
NK = Tinggi (0,4)
80 50 0
1
Rendah Tinggi
100
Nilai Kelayakan
skala [0, 100]
0,5
80 50 0
1
Rendah Tinggi
100
Nilai Kelayakan
skala [0, 100]
0,4
(a)
(b)
50 0
1
Rendah Tinggi
100
Nilai Kelayakan
skala [0, 100]
0,5
0,4
50 0
1
Rendah Tinggi
100
Nilai Kelayakan
skala [0, 100]
0,5
0,4
10 20 30 40 60 80 90
Center of gravity?
70
39 , 52
6 , 4
136 105
*
) 4 , 0 ( 4 ) 5 , 0 ( 6
4 , 0 ) 100 90 80 70 ( 5 , 0 ) 60 50 40 30 20 10 (
*
=
+
=
+
+ + + + + + + + +
=
y
y
IPK mahasiswa B
Gaji Orangtua mhs B
Conjunction (.) & Disjunction (v)
Tinggi(0) THEN Sedang(0) AND ) 48 , 0 ( Besar IF
8) Tinggi(0,4 THEN Kecil(1) AND ) 48 , 0 ( Besar IF
Rendah(0) THEN Sedang(0) AND ) Cukup(0,52 IF
2) Tinggi(0,5 THEN Kecil(1) AND ) Cukup(0,52 IF
= = =
= = =
= = =
= = =
NK Gaji IPK
NK Gaji IPK
NK Gaji IPK
NK Gaji IPK
NK = Rendah (0)
NK = Tinggi (0,52)
80 50 0
1
Rendah Tinggi
Nilai Kelayakan
skala [0, 100]
0,52
70
Center of gravity?
65 60
69,66
2,87334
78 5 , 32 20
*
2 ) 52 , 0 ( ) 2 / 1 ( ) 3 / 1 (
) 52 , 0 )( 80 70 ( ) 2 / 1 ( 65 ) 3 / 1 ( 60
*
=
+ +
=
+ +
+ + +
=
y
y
Keputusan Model Mamdani
Mahasiswa B dengan IPK = 2,99 dan Gaji orangtuanya
sebesar 1 juta rupiah per bulan memperoleh Nilai
Kelayakan sebesar 69,66.
Lebih besar dibandingkan dengan Nilai Kelayakan
mahasiswa A yang sebesar 52,39.
Jadi, mahasiswa B layak mendapatkan beasiswa.
Model Mamdani
Model Sugeno
Model ini sering digunakan untuk membangun sistem
kontrol yang membutuhkan respon cepat.
Proses perhitungannya sangat sederhana sehingga
membutuhkan waktu relatif cepat sehingga sangat
sesuai untuk sistem kontrol.
Bagaimana jika digunakan untuk masalah pemberian
beasiswa?
Kasus 1: Pemberian Beasiswa
Mahasiswa IPK Gaji Ortu (Rp/bulan)
A 3,00 10 juta
B 2,99 1 juta
Fuzzification
Inference
Defuzzification
Fuzzy rules
Crisp input
Fuzzy input
Output Fuzzy output
Crisp value
Fuzzification & Rule Evaluation
Misalkan proses fuzzification-nya sama persis
dengan model Mamdani.
Misalkan Rule yang digunakan juga sama persis
dengan model Mamdani.
Mahasiswa A
) Rendah(0,5 THEN Besar(0,6) Sangat AND Bagus(0,5) IF
) Tinggi(0,4 THEN Besar(0,4) AND Bagus(0,5) IF
) Rendah(0,5 THEN Besar(0,6) Sangat AND ) 5 , 0 ( Cukup IF
) Rendah(0,4 THEN Besar(0,4) AND Cukup(0,5) IF
= = =
= = =
= = =
= = =
NK Gaji IPK
NK Gaji IPK
NK Gaji IPK
NK Gaji IPK
NK = Rendah (0,5)
NK = Tinggi (0,4)
FK singleton untuk Nilai Kelayakan
80 50 0
1
Rendah Tinggi
Nilai Kelayakan
skala [0, 100]
Untuk mahasiswa A
80 50 0
1
Rendah Tinggi
Nilai Kelayakan
skala [0, 100]
0,5
80 50 0
1
Rendah Tinggi
100
Nilai Kelayakan
skala [0, 100]
0,4
(a)
(b)
NK = Rendah (0,5)
NK = Tinggi (0,4)
Proses Composition
1
Rendah Tinggi
0,5
0,4
Nilai Kelayakan
skala [0, 100]
0 80 50
Defuzzyfication: Weighted Average
33 , 63
) 4 , 0 ( ) 5 , 0 (
80 ) 4 , 0 ( 50 ) 5 , 0 (
* =
+
+
= y
Mahasiswa B
Tinggi(0) THEN Sedang(0) AND ) 48 , 0 ( Besar IF
8) Tinggi(0,4 THEN Kecil(1) AND ) 48 , 0 ( Besar IF
Rendah(0) THEN Sedang(0) AND ) Cukup(0,52 IF
2) Tinggi(0,5 THEN Kecil(1) AND ) Cukup(0,52 IF
= = =
= = =
= = =
= = =
NK Gaji IPK
NK Gaji IPK
NK Gaji IPK
NK Gaji IPK
NK = Rendah (0)
NK = Tinggi (0,52)
Untuk Mahasiswa B
1
Rendah Tinggi
0,52
Nilai Kelayakan
skala [0, 100]
0 80 50
NK = Rendah (0)
NK = Tinggi (0,52)
Defuzzyfication: Weighted Average
80
52 , 0 0
80 ) 52 , 0 ( 50 ) 0 (
* =
+
+
= y
Keputusan Model Sugeno
Mahasiswa B dengan IPK = 2,99 dan Gaji orangtuanya
sebesar Rp 1 juta per bulan memperoleh Nilai
Kelayakan sebesar 80.
Lebih besar dibandingkan dengan Nilai Kelayakan
mahasiswa A yang sebesar 63,33.
Jadi, mahasiswa B layak mendapatkan beasiswa.
2,00 2,75 0
1
3,25
Buruk Cukup Bagus
4,00
IPK
1 3 0
1
6
Kecil Sedang Besar
12
Gaji orangtua
(juta rupiah)
Sangat
Besar
4 7
Buruk
Cukup
Bagus
Kecil Sedang Besar Sangat Besar
Rendah
IPK
Gaji
Tinggi
Tinggi
Tinggi
Rendah Rendah Rendah
Rendah
Rendah Tinggi
Rendah Rendah
80 50 0
1
Rendah Tinggi
Nilai Kelayakan
skala [0, 100]
Bahu kiri Bahu kanan
Model Sugeno
Model Mamdani Model Sugeno
Nilai Kelayakan mahasiswa A & B
Mahasiswa
Nilai Kelayakan mendapat
beasiswa
Model Mamdani Model Sugeno
A 52,39 63,33
B 69,66 80
Selisih A dan B 17,72 16,67
Sistem Berbasis Crisp Sets dan FOL
...
...
...
3 , 2 6 THEN juta 1,25 AND 57 , 2 IF
5 , 2 6 THEN juta 1,20 AND 57 , 2 IF
= = =
= = =
NK Gaji IPK
NK Gaji IPK
Aturan FOL untuk proses inference
P1
P2
P3
G1 G2 G3 G4
70
IPK
Gaji
90
80
G5
P4 100
60
80
70
90
50
70
60
40 30
50
40
60
30
50
40
20
Aturan FOL untuk proses inference
50 ) 5 , ( ) 4 , ( IF 20.
...
...
...
0 6 ) 2 , ( ) 1 , ( IF . 2
0 7 ) 1 , ( ) 1 , ( IF . 1
= .
= .
= .
NK G Gaji Interval P IPK Interval
NK G Gaji Interval P IPK Interval
NK G Gaji Interval P IPK Interval
Kelemahan
Dengan menggunakan 20 aturan FOL di atas, tentu
saja sistem akan mengeluarkan output berupa salah
satu dari 20 nilai yang kita definisikan tersebut.
Dengan kata lain, sistem ini sangat statis.
Untuk masalah yang membutuhkan tingkat ketelitian
tinggi atau yang adil secara intuitif, tentu saja cara ini
tidak bisa digunakan.
Sistem yang Linier
) 20 / ) 20 (( ) 4 / (
2 1
Gaji W IPK W NK + =
W
1
adalah bobot untuk IPK, W
2
adalah bobot untuk Gaji.
Asumsi: IPK maksimum adalah 4,00
Asumsi: Gaji Orang tua maksimum adalah Rp 20 jt/bln.
Karena skala untuk NK adalah [0, 100], maka W
1
+ W
2
harus sama dengan 100.
W
1
= 50 dan W
2
= 50
Mhs A
Mhs B
W
1
= 80 dan W
2
= 20
Mhs A
Mhs B
Kelebihan Fuzzy Systems
Kebanyakan permasalahan dunia nyata: non linier
Sistem berbasis crisp set dengan pembobotan sulit
digunakan karena menghasilkan grafik yang linier.
Untuk menyelesaikan masalah non linier, tentu saja
dibutuhkan sistem yang juga bersifat non linier.
Dilihat dari proses dan keluarannya, sistem berbasis
fuzzy set memiliki sifat non linier.
Kasus 1: Pemberian Beasiswa
Mahasiswa IPK Gaji Ortu (Rp/bulan)
A 3,00 10 juta
B 2,99 1 juta
2,00 2,75 0
1
3,25
Buruk Cukup Bagus
4,00
IPK
1 3 0
1
6
Kecil Sedang Besar
12
Gaji orangtua
(juta rupiah)
Sangat
Besar
4 7
Buruk
Cukup
Bagus
Kecil Sedang Besar Sangat Besar
Rendah
IPK
Gaji
Tinggi
Tinggi
Tinggi
Rendah Rendah Rendah
Rendah
Rendah Tinggi
Rendah Rendah
80 50 0
1
Rendah Tinggi
Nilai Kelayakan
skala [0, 100]
Bahu kiri Bahu kanan
2,75 0
1
10
Kecil Sedang Besar
20
Gaji Orang tua
(juta rupiah)
Sangat Besar
100 50 0
1
Rendah Tinggi
Nilai Kelayakan
skala [0, 100]
75
Sedang
Buruk
Cukup
Bagus
Kecil Sedang Besar Sangat Besar
Sedang
IPK
Gaji
Tinggi
Tinggi
Tinggi
Rendah Rendah Rendah
Rendah
Sedang Tinggi
Sedang Tinggi
2,75 0
1
10
Kecil Sedang Besar
20
Gaji Orang tua
(juta rupiah)
Sangat Besar
100 40 0
1
10
Kecil Sedang Besar
20
Gaji Orang tua
(juta rupiah)
Sangat Besar
100 40 0
1
Fuzzy rules
Crisp input
Fuzzy input
Output Fuzzy output
Crisp value
Proses fuzzification
Warm = -(37-39)/(39-36) = 2/3.
Hot = (37-36)/(39-36) = 1/3.
Dry = -(12-20)/(20-10) = 4/5
Moist = (12-10)/(20-10) = 1/5
Proses inferensi
Proses inference
Dari empat data fuzzy input di atas, Warm (2/3),
Hot (1/3), Dry (4/5) dan Moist (1/5), maka kita
mendapatkan 4 aturan (dari 15 aturan) yang dapat
diaplikasikan:
IF Suhu is Warm (2/3) AND Kelembaban is Dry (4/5)
THEN Durasi is Long (2/3)
IF Suhu is Warm (2/3) AND Kelembaban is Moist (1/5)
THEN Durasi is Medium (1/5)
IF Suhu is Hot (1/3) AND Kelembaban is Dry (4/5)
THEN Durasi is Long (1/3)
IF Suhu is Hot (1/3) AND Kelembaban is Moist (1/5)
THEN Durasi is Medium (1/5)
Inference: Model Sugeno
Defuzzyfication: Weighted Average
Kasus 2: Sprinkle CS
Input:
Suhu Udara (
0
C)
Kelembaban Tanah (%)
Cahaya Matahari (Cd / Candela)
Output: Durasi Penyiraman (menit)
Misal:
Suhu = 37
0
C, kelembaban = 12%, Cahaya = 400 Cd.
Berapa lama durasi penyiraman yang dilakukan?
Kasus 2: Sprinkle CS
Model Mamdani atau Sugeno?
Jumlah Nilai Linguistik untuk setiap variabel?
Fungsi Keanggotaan: Segitiga, trapesium, phi, ?
Batas-batas Nilai Linguistik?
Fuzzy rule yang tepat?
Kasus 3: Traffic Light Controller
Kasus 3: Traffic Light Controller
Bisakah fuzzy menyelesaikannya?
Jika bisa, bagaimana desain Fuzzy yang baik?
Jika tidak, apa alasannya?
Fuzzy?
Yes!
Kasus 3: Traffic Light Controller
[Shahariz Abdul Aziz & Jeyakody Parthiban]
Kasus 4: Akreditasi Prodi
Pendidikan dan Pengajaran
Pendidikan Dosen: S1, S2, S3?
Jabatan Akademik: AA, L, LK, GB?
Rasio Dosen : Mhs?
Penelitian
Dana proyek?
Paper Ilmiah?
Pengabdian Masyarakat
Jumlah kegiatan per tahun?
Manfaat bagi masyarakat?
Kasus 4: Akreditasi Prodi
Bisakah fuzzy menyelesaikannya?
Jika bisa, bagaimana desain Fuzzy yang baik?
Jika tidak, apa alasannya?
Fuzzy?
No!
Kasus 5: University Rankings
Bagaimana mengelompokkan universitas ke dalam cluster
yang secara statistik mirip untuk semua kriteria yg ada?
Clustering harus dilakukan tanpa asumsi apapun tentang
tingkat kepentingan relatif dari semua kriteria.
Kriteria:
Jumlah profesor?
Jumlah mhs asing?
Rasio Dosen:Mhs?
Besarnya Dana proyek?
Jumlah Paper Ilmiah?
Kasus 5: University Rankings
Bisakah fuzzy menyelesaikannya?
Jika bisa, bagaimana desain Fuzzy yang baik?
Jika tidak, apa alasannya?
Fuzzy?
Yes!
Kasus 5: University Rankings
Shanghai Jao Tong University (SJTU)
The Time Higher League Table (THES)
Metode: Fuzzy Clustering
Top 500 Univerisities in the world
1. Harvard
2. Stanford
3. Cambridge
69. NTU Singapore
280. Universitas Indonesia
9999. IT Telkom (Masuk top 500 pada 2017?????????)
Fuzzy Clustering
To extract rules from data
Fuzzy c-means
Aplikasi:
Cracked Tile Detection
Finding Cancer Cells
Image Segmentation
Document clustering
Cluster
Sejumlah individu yang memiliki sifat hampir sama
atau terjadi bersama-sama
Kelompok universitas kelas dunia
Kelompok mobil kategori tertentu
Kumpulan spam email
Kumpulan tipe penyakit kanker
Cluster Analysis
A statistical classification technique
for discovering whether the individuals of a population
fall into different groups
by making quantitative comparisons of multiple
characteristics.
Vehicle
Vehicle Top speed
km/h
Colour Air
resistance
Weight
Kg
V1 220 red 0.30 1300
V2 230 black 0.32 1400
V3 260 red 0.29 1500
V4 140 gray 0.35 800
V5 155 blue 0.33 950
V6 130 white 0.40 600
V7 100 black 0.50 3000
V8 105 red 0.60 2500
V9 110 gray 0.55 3500
100 150 200 250 300
500
1000
1500
2000
2500
3000
3500
Top speed [km/h]
W
e
i
g
h
t
[
k
g
]
Sports cars
Medium market cars
Lorries
Object or data point
feature
feature
space
cluster
feature
label
Kasus 6: Tile Clustering
Tiles are made from clay moulded into the right
shape, brushed, glazed, and baked.
Unfortunately, the baking may produce invisible
cracks.
Operators can detect the cracks by hitting the tiles
with a hammer, and in an automated system the
response is recorded with a microphone, filtered,
Fourier transformed, and normalised.
A small set of data is given in the TABLE below.
Kasus 6: Tile Clustering
475Hz 557Hz Ok?
0.958 0.003 Yes
1.043 0.001 Yes
1.907 0.003 Yes
0.780 0.002 Yes
0.579 0.001 Yes
0.003 0.105 No
0.001 1.748 No
0.014 1.839 No
0.007 1.021 No
0.004 0.214 No
[MIT, 1997]
Plot of tiles by frequencies (logarithms). The whole tiles (o) seem
well separated from the cracked tiles (*). The objective is to find
the two clusters.
-8 -6 -4 -2 0 2
-8
-7
-6
-5
-4
-3
-2
-1
0
1
2
log(intensity) 475 Hz
l
o
g
(
i
n
t
e
n
s
i
t
y
)
5
5
7
H
z
Tiles data: o = whole tiles, * = cracked tiles, x = centres
1. Place two cluster centres (x) at random.
2. Assign each data point (* and o) to the nearest cluster centre (x)
-8 -6 -4 -2 0 2
-8
-7
-6
-5
-4
-3
-2
-1
0
1
2
log(intensity) 475 Hz
l
o
g
(
i
n
t
e
n
s
i
t
y
)
5
5
7
H
z
Tiles data: o = whole tiles, * = cracked tiles, x = centres
-8 -6 -4 -2 0 2
-8
-7
-6
-5
-4
-3
-2
-1
0
1
2
log(intensity) 475 Hz
l
o
g
(
i
n
t
e
n
s
i
t
y
)
5
5
7
H
z
Tiles data: o = whole tiles, * = cracked tiles, x = centres
1. Compute the new centre of each class
2. Move the crosses (x)
Iteration 2
-8 -6 -4 -2 0 2
-8
-7
-6
-5
-4
-3
-2
-1
0
1
2
log(intensity) 475 Hz
l
o
g
(
i
n
t
e
n
s
i
t
y
)
5
5
7
H
z
Tiles data: o = whole tiles, * = cracked tiles, x = centres
Iteration 3
-8 -6 -4 -2 0 2
-8
-7
-6
-5
-4
-3
-2
-1
0
1
2
log(intensity) 475 Hz
l
o
g
(
i
n
t
e
n
s
i
t
y
)
5
5
7
H
z
Tiles data: o = whole tiles, * = cracked tiles, x = centres
Iteration 4 (then stop, because no visible change)
Each data point belongs to the cluster defined by the nearest centre
-8 -6 -4 -2 0 2
-8
-7
-6
-5
-4
-3
-2
-1
0
1
2
log(intensity) 475 Hz
l
o
g
(
i
n
t
e
n
s
i
t
y
)
5
5
7
H
z
Tiles data: o = whole tiles, * = cracked tiles, x = centres
The membership matrix M:
1. The last five data points (rows) belong to the first cluster (column)
2. The first five data points (rows) belong to the second cluster (column)
M =
0.0000 1.0000
0.0000 1.0000
0.0000 1.0000
0.0000 1.0000
0.0000 1.0000
1.0000 0.0000
1.0000 0.0000
1.0000 0.0000
1.0000 0.0000
1.0000 0.0000
Each data point belongs to two clusters to different degrees
-8 -6 -4 -2 0 2
-8
-7
-6
-5
-4
-3
-2
-1
0
1
2
log(intensity) 475 Hz
l
o
g
(
i
n
t
e
n
s
i
t
y
)
5
5
7
H
z
Tiles data: o = whole tiles, * = cracked tiles, x = centres
1. Place two cluster centres
2. Assign a fuzzy membership to each data point depending on
distance
-8 -6 -4 -2 0 2
-8
-7
-6
-5
-4
-3
-2
-1
0
1
2
log(intensity) 475 Hz
l
o
g
(
i
n
t
e
n
s
i
t
y
)
5
5
7
H
z
Tiles data: o = whole tiles, * = cracked tiles, x = centres
1. Compute the new centre of each class
2. Move the crosses (x)
-8 -6 -4 -2 0 2
-8
-7
-6
-5
-4
-3
-2
-1
0
1
2
log(intensity) 475 Hz
l
o
g
(
i
n
t
e
n
s
i
t
y
)
5
5
7
H
z
Tiles data: o = whole tiles, * = cracked tiles, x = centres
Iteration 2
-8 -6 -4 -2 0 2
-8
-7
-6
-5
-4
-3
-2
-1
0
1
2
log(intensity) 475 Hz
l
o
g
(
i
n
t
e
n
s
i
t
y
)
5
5
7
H
z
Tiles data: o = whole tiles, * = cracked tiles, x = centres
Iteration 5
-8 -6 -4 -2 0 2
-8
-7
-6
-5
-4
-3
-2
-1
0
1
2
log(intensity) 475 Hz
l
o
g
(
i
n
t
e
n
s
i
t
y
)
5
5
7
H
z
Tiles data: o = whole tiles, * = cracked tiles, x = centres
Iteration 10
-8 -6 -4 -2 0 2
-8
-7
-6
-5
-4
-3
-2
-1
0
1
2
log(intensity) 475 Hz
l
o
g
(
i
n
t
e
n
s
i
t
y
)
5
5
7
H
z
Tiles data: o = whole tiles, * = cracked tiles, x = centres
Iteration 13 (then stop, because no visible change)
Each data point belongs to the two clusters to a degree
-8 -6 -4 -2 0 2
-8
-7
-6
-5
-4
-3
-2
-1
0
1
2
log(intensity) 475 Hz
l
o
g
(
i
n
t
e
n
s
i
t
y
)
5
5
7
H
z
Tiles data: o = whole tiles, * = cracked tiles, x = centres
The membership matrix M:
1. The last five data points (rows) belong mostly to the first cluster (column)
2. The first five data points (rows) belong mostly to the second cluster (column)
M =
0.0025 0.9975
0.0091 0.9909
0.0129 0.9871
0.0001 0.9999
0.0107 0.9893
0.9393 0.0607
0.9638 0.0362
0.9574 0.0426
0.9906 0.0094
0.9807 0.0193
Kasus 7: Klasifikasi Sel Kanker
Normal smear Severely dysplastic smear
Possible Features
Nucleus and cytoplasm area
Nucleus and cyto brightness
Nucleus shortest and longest diameter
Cyto shortest and longest diameter
Nucleus and cyto perimeter
Nucleus and cyto no of maxima
...
Classes are nonseparable
Hard Classifier (HCM)
A cell is either one
or the other class
defined by a colour.
OK light moderate OK severe
Fuzzy Classifier (FCM)
A cell can belong to
several classes to a
Degree, i.e., one column
may have several
colours.
OK light moderate OK severe
Kasus 8: Image Segmentation
Sangat penting untuk image analysis, understanding,
dan coding
Bagaimana memisahkan satu objek yang diinginkan
dari objek2 lainnya?
Pada image terdapat banyak ambiguitas
(a) Original cow image,
(b) Manually segmented
reference image for (a).
(c) FCM with pixel locations
(d) FCM with pixel intensity
(e) FCM with both features
(f) Fuzzy Clustering
Incorporating Spatial
Information (FCSI).
[M. Ameer Ali, Gour C
Karmakar and Laurence S
Dooley, Image Segmentation
Using Fuzzy Clustering
Incorporating Spatial
Information, Monash
University, Australia]
Kasus 9: Documents Clustering
Text represented as an unordered collection of
words
Using tf-idf (term frequencyinverse document
frequency)
Document = one vector in high dimensional
space
Similarity = cosine similarity between vectors
PROBLEM
Grouping conference papers with regard to their contents into
predefined sessions schedule.
Session A
(3 papers)
Coffee break
EXAMPLE
Session B
(4 papers)
Lunch break
Session C
(4 papers)
Session D
(3 papers)
Coffee break
Papers
Sessions schedule
Constraint-based
clustering
Session A Title
Session B Title
Session C Title
Session D Title
[Matja Juri, Vid Podpean, Nada Lavra ]
Combining CBC & Fuzzy Clustering
PHASE 1 SOLUTION
constrained-based clustering (CBC)
DIFFICULTIES
CBC can get stuck in local minimum
often low quality result (created schedule)
user interaction needed to repair schedule
PHASE 2 NEEDED
run fuzzy clustering (FC) with initial clusters from CBC
if output clusters of FC differ from CBC repeat everything
if the clusters of FC equal to CBC show new info to user
[Matja Juri, Vid Podpean, Nada Lavra ]
RUN FUZZY CLUSTERING ON PHASE 1 RESULTS
- insight into result quality
- identify problematic papers
Coffee break
EXAMPLE
Lunch break
Coffee break
Sessions schedule
Session A Title
Session B Title
Session C Title
Session D Title
13%
42%
[Matja Juri, Vid Podpean, Nada Lavra ]
Masalah Tugas Akhir IF
Clustering dokumen TA berdasarkan KBK
Clustering Dosen berdasarkan Keahliannya
Penentuan Dosen Penguji Sidang TA
Hard Classifier
Ketidakpastian didekati dengan Kepastian
Ketidakpastian
[Matja Juri, Vid Podpean, Nada Lavra ]
Fuzzy Classifier
Ketidakpastian didekati dengan Kesamaran
(mendekati) Kepastian
[Matja Juri, Vid Podpean, Nada Lavra ]
Procedure to find a model
1. Acquire data
2. Select structure
3. Find clusters, generate model
4. Validate model
Kesulitan Fuzzy Systems
Model Mamdani atau Sugeno atau model lain?
Jumlah Nilai Linguistik untuk setiap variabel?
Fungsi Keanggotaan: Segitiga, trapesium, phi, ?
Batas-batas Nilai Linguistik?
Fuzzy rule yang tepat?
Solusi
Semua komponen fuzzy bisa didefinisikan secara
otomatis menggunakan EAs atau ANN.
Evolving Fuzzy Systems
Neuro-Fuzzy
Fuzzy Systems yang bisa LEARNING
Perlu data latih yang MEMADAI
Pemberian Beasiswa
NIM IPK Gaji Ortu (juta rupiah) Nilai Kelayakan
070001 2,0 16 45
070002 2,5 12 50
070003 3,6 30 55
070004 1,5 140 10
070005 2,7 10 40
070006 3,9 0,5 95
070007 1,9 1 52
070008 2,8 8 68
070009 3,5 6 72
070010 2,0 7 53
Sprinkler Control System
Tanggal Waktu Suhu (
o
C) Kelembaban Tanah (%) Durasi Penyiraman (menit)
01-02-2006 08:00 20 16 55,7
01-02-2006 13:00 25 12 59,3
01-02-2006 18:00 16 30 5,6
02-02-2006 07:00 15 14 30,1
02-02-2006 12:00 27 10 43,4
02-02-2006 19:00 12 19 18,6
03-02-2006 06:30 19 12 22,1
03-02-2006 10:00 28 8 47,3
03-02-2006 13:30 35 6 76,4
03-02-2006 16:00 20 17 20,9
Evolving Fuzzy Systems
Representasi Individu?
Fungsi fitness-nya?
Algoritma EAs?
Operator-operator evolusi?
Kesimpulan
Untuk masalah dengan jumlah aturan yang sangat
banyak, seperti permainan catur, teknik Reasoning
lebih sesuai dibandingkan teknik searching.
Keuntungan dari teknik Reasoning adalah kemudahan
dalam melakukan majemen pengetahuan.
Propositional logic adalah logic paling sederhana yang
terlalu lemah untuk digunakan dalam
merepresentasikan pengetahuan, sehingga hampir
tidak pernah digunakan untuk penyelesaian masalah
di dunia nyata.
Kesimpulan
First-Order Logic cukup memadai untuk
merepresentasikan pengetahuan, sehingga banyak
digunakan untuk penyelesaian masalah dunia nyata.
Untuk membangun knowledge-based agent, pekerjaan
paling berat adalah bagaimana membangun basis
pengetahuan yang benar dan lengkap.
Knowledge engineer harus memiliki:
Domain pertanyaan
Bahasa representasi
Implementasi prosedur inferensi
Kesimpulan
Untuk permasalahan yang mengandung
ketidakpastian, fuzzy logic adalah pilihan yang tepat.
Fuzzy logic menunjukkan performansi yang bagus
untuk berbagai masalah, khususnya optimasi dan
sistem kontrol.
Daftar Pustaka
[SUY07] Suyanto. 2007. Artificial Intelligence: Searching, Reasoning,
Planning and Learning. Informatika, Bandung Indonesia. ISBN: 979-
1153-05-1.
[RUS95] Russel, Stuart and Norvig, Peter. 1995. Artificial Intelligence:
A Modern Approach. Prentice Hall International, Inc.
[SUY08b] Suyanto. 2008. Soft Computing: Membangun Mesin Ber-IQ
Tinggi. Informatika, Bandung Indonesia. ISBN: 978-979-1153-49-2.