S1 Teknik Informatika Fakultas Teknologi Informasi Universitas Kristen Maranatha

dokumen-dokumen yang mirip
Klasifikasi. Agenda. Pendahuluan Klasifikasi Induksi Pohon Keputusan Klasifikasi Bayesian classification 31/10/2014

Klasifikasi. Diadaptasi dari slide Jiawei Han

Klasifikasi. Diadaptasi dari slide Jiawei Han

Bayesian Classifier. Bahan Kuliah Data Mining. Dr. Taufik Fuadi Abidin, S.Si., M.Tech. Program Studi Teknik Informatika FMIPA Universitas Syiah Kuala

LEARNING. Program Studi Ilmu Komputer FPMIPA UPI RNI IK460(Kecerdasan Buatan)

BAB II TINJAUAN PUSTAKA

BAB 2 LANDASAN TEORI

BAB III REGRESI LOGISTIK BINER DAN CLASSIFICATION AND REGRESSION TREES (CART) Odds Ratio

Penggunaan Pohon Keputusan untuk Data Mining

Materi Praktikum Data Mining Decision Tree Program Studi Informatika / Matematika FMIPA Universitas Syiah Kuala

PEMBENTUKAN DECISION TREE DATA LAMA STUDI MAHASISWA MENGGUNAKAN ALGORITMA NBTREE DAN C4.5

M. Zidny Naf an Gasal 2016/2017

TINJAUAN PUSTAKA. Definisi Data Mining

Modul IV KLASIFIKASI

Pohon Keputusan. 6.1 Inductive Learning

Sekip Utara Yogyakarta * 1 2

PENERAPAN ALGORITMA C5.0 DALAM PENGKLASIFIKASIAN DATA MAHASISWA UNIVERSITAS NEGERI GORONTALO

BAB 2. Landasan Teori

BAB I PENDAHULUAN 1.1 Latar Belakang

BAB II TINJAUAN PUSTAKA

PRAKTIKUM KE-5 KLASIFIKASI I

Model Data Mining sebagai Prediksi Penyakit Hipertensi Kehamilan dengan Teknik Decision Tree

Konsep Data Mining. Klasifikasi : Pohon Keputusan. Bertalya Universitas Gunadarma 2009

BAB II TINJAUAN PUSTAKA

KLASIFIKASI PADA TEXT MINING

POHON KEPUTUSAN DENGAN ALGORITMA C4.5

Moch. Ali Machmudi 1) 1) Stmik Bina Patria

BAB 2 LANDASAN TEORI

ISSN : STMIK AMIKOM Yogyakarta, 6-8Februari 2015

ANALISIS PERFORMA ALGORITME WEIGHTED NAIVE BAYES CLASSIFIER. Abstrak

Data Mining Pengklasifikasian: Konsep Dasar, Pohon Keputusan, and Evaluasi Model. Pengklasifikasian: Definisi. Catatan Kuliah untuk Bab 4

BAB III PEMBAHASAN. Sumber data diperoleh dari Koperasi X yang terdiri dari 3 file excel

Versi Online tersedia di : JURNAL TECH-E (Online)

PENERAPAN DECISION TREE UNTUK PENENTUAN POLA DATA PENERIMAAN MAHASISWA BARU

MKB3462 KECERDASAN BUATAN. Muhammad Zidny Naf an, M.Kom.

KLASIFIKASI PADA TEXT MINING

BAB IV HASIL PENELITIAN DAN PEMBAHASAN

Sebelumnya... Sistem Pakar berbasis Logika Fuzzy

PREDIKSI HERREGISTRASI CALON MAHASISWA BARU MENGGUNAKAN ALGORITMA NAÏVE BAYES

MODUL 12 Model Prediktif

BAB I PENDAHULUAN 1.1 Latar Belakang

BAB II TINJAUAN PUSTAKA Indeks Prestasi Kumulatif dan Lama Studi. menggunakan dokumen/format resmi hasil penilaian studi mahasiswa yang sudah

BAB II KAJIAN TEORI. Pada bab ini berisi tentang teori-teori dasar mengenai kredit, database,

BAB II TINJAUAN PUSTAKA DAN LANDASAN TEORI. yang tepat. Sistem data mining mampu memberikan informasi yang tepat dan

PEMBENTUKAN MODEL KLASIFIKASI DATA LAMA STUDI MAHASISWA STMIK INDONESIA MENGGUNAKAN DECISION TREE DENGAN ALGORITMA NBTREE

Jurnal String Vol. 1 No. 1 Tahun 2016 ISSN:

CONTOH KASUS DATA MINING

BAB I PENDAHULUAN. 1.1 Latar Belakang

SISTEM PENDUKUNG PENGAMBILAN KEPUTUSAN MENGGUNAKAN METODE NAIVE BAYES (STUDI KASUS KREDIT SEPEDA MOTOR)

BAB III METODE PENELITIAN

BAB II TINJAUAN PUSTAKA

PENCARIAM JURUSAN SUBANG DENGAN ALGORITMA C 4.5 DAN DATA MINING STMIK SUBANG Timbo Faritcan Parlaungan Siallagan

BAB 2 TINJAUAN PUSTAKA

BAB I PENDAHULUAN 1.1 Latar Belakang 1.2 Perumusan Masalah

BAB 1 PENDAHULUAN 1-1

BAB II TINJAUAN PUSTAKA

ALGORITMA C4.5 UNTUK SIMULASI PREDIKSI KEMENANGAN DALAM PERTANDINGAN SEPAKBOLA

BAB I PENDAHULUAN Latar Belakang

Alfa Saleh. Teknik Informatika Universitas Potensi Utama Jl K.L. Yos Sudarso KM 6.5 No.3-A, Tanjung Mulia, Medan

Keoptimalan Naïve Bayes Dalam Klasifikasi

KLASIFIKASI KARAKTERISTIK MAHASISWA UNIVERSITAS COKROAMINOTO PALOPO MENGGUNAKAN METODE NAÏVE BAYES DAN DECISION TREE. Yuli Hastuti

Jurnal Informatika Mulawarman Vol. 12, No. 1, Februari ISSN

BAB III METODE PENELITIAN

PENERAPAN DATA MINING UNTUK EVALUASI KINERJA AKADEMIK MAHASISWA MENGGUNAKAN ALGORITMA NAÏVE BAYES CLASSIFIER

KONVERSI DATA TRAINING TENTANG PENYAKIT HIPERTENSI MENJADI BENTUK POHON KEPUTUSAN DENGAN TEKNIK KLASIFIKASI MENGGUNAKAN TOOLS RAPID MINER 4.

BAB II LANDASAN TEORI

THE APPLICATION OF DATA MINING FOR OLD STUDENT TO PREDICTION STUDIES USING NAIVE BAYES AND ADABOOST METHOD

PENERAPAN ALGORITMA NAÏVE BAYES UNTUK DETEKSI BAKTERI E-COLI

ANALISIS KLASIFIKASI PADA NASABAH KREDIT KOPERASI X MENGGUNAKAN DECISION TREE C4.5 DAN NAÏVE BAYES

BAB 2 TELAAH PUSTAKA

BAB II TINJAUAN PUSTAKA DAN DASAR TEORI. Dalam tinjauan pustaka dibawah ini terdapat 6 referensi sebagai berikut : - Algoritma Naïve Bayes Classifier

Implementasi Metode Klasifikasi Naïve Bayes Dalam Memprediksi Besarnya Penggunaan Listrik Rumah Tangga

BAB II LANDASAN TEORI

BAB 1 PENDAHULUAN. 1.1 Latar Belakang Masalah

IMPLEMENTASI ALGORITMA ID3 UNTUK KLASIFIKASI PERFORMANSI MAHASISWA (STUDI KASUS ST3 TELKOM PURWOKERTO)

IMPLEMENTASI DATA MINING DENGAN NAIVE BAYES CLASSIFIER UNTUK MENDUKUNG STRATEGI PEMASARAN DI BAGIAN HUMAS STMIK AMIKOM YOGYAKARTA

BAB I PENDAHULUAN 1.1 Latar Belakang

BAB II TINJAUAN PUSTAKA DAN LANDASAR TEORI

Universitas Putra Indonesia YPTK Padang Fakultas Ilmu Komputer Program Studi Teknik Informatika. Classification Decision Tree

Classification (1) Classification (3) Classification (2) Contoh Classification. Classification (4)

PREDIKSI KEBANGKRUTAN PERUSAHAAN MENGGUNAKAN ALGORITMA C4.5 BERBASIS FORWARD SELECTION

Kecerdasan Buatan Materi 6. Iterative Dichotomizer Three (ID3)

BAB II LANDASAN TEORI

IMPLEMENTASI TEKNIK DATA MINING CLASSIFICATION DENGAN METODE DECISSION TREE UNTUK MENENTUKAN TINGKAT KELULUSAN MAHASISWA

ID3 : Induksi Decision Tree

Jurnal Komputer Terapan Vol. 3, No. 2, November 2017, Jurnal Politeknik Caltex Riau

BAB I PENDAHULUAN 1.1 Latar Belakang

Algoritma Dasar. 4.1 Naive Bayes

BAB II TINJAUAN PUSTAKA

APLIKASI KLASIFIKASI PEMENUHAN GIZI PADA LANSIA MENGGUNAKAN METODE DECISION TREE ID3

BAB III METODOLOGI PENELITIAN. Dataset

Penerapan Algoritma C4.5 Untuk Menentukan Kesesuaian Lensa Kontak dengan Mata Pasien

PENERAPAN TEKNIK DATA MINING UNTUK MENENTUKAN HASIL SELEKSI MASUK SMAN 1 GIBEBER UNTUK SISWA BARU MENGGUNAKAN DECISION TREE

PENERAPAN ALGORITMA KLASIFIKASI C4.5 UNTUK DIAGNOSIS PENYAKIT KANKER PAYUDARA

DATA MINING POTENSI AKADEMIK SISWA BERBASIS ONLINE

MODEL DATA MINING CAPAIAN PEMBELAJARAN. N. Tri Suswanto Saptadi. Definisi Kategori Model Naïve Bayesian k-nearest Neighbor Clustering 12/4/2015

Teknik Pengklasifikasi : Bayesian, JST (ANN) Bertalya Universitas Gunadarma 2009

Data Mining II Estimasi

DIAGNOSIS PENYAKIT KANKER PAYUDARA MENGGUNAKAN METODE NAIVE BAYES BERBASIS DESKTOP

BAB II LANDASAN TEORI

Transkripsi:

S1 Teknik Informatika Fakultas Teknologi Informasi Universitas Kristen Maranatha

Pendahuluan Classification Decision tree induction Bayesian classification 2

Classification : klasifikasi data berdasarkan training set and nilai-nilai (class labels) dalam klasifikasi atribut, dan menggunakannya dalam klasifikasi data baru memprediksi label kelas secara kategorikal (diskrit/nominal) Prediction memodelkan fungsi kontinyu, mis. prediksi nilai hilang atau tidak diketahui Contoh aplikasi Credit approval : pinjaman aman atau beresiko Target marketing : customer potensial Medical diagnosis Fraud detection Teknik-teknik : Classification : decision tree induction, Bayesian classification, Bayesian belief network, neural network, k-nearest neighbour classifier, CBR, algoritma genetic, rough set, fuzzy logic Prediction: Linear, nonlinear, generalized linear regression 3

Model construction: describing a set of predetermined classes Setiap sample diasumsikan termasuk predefined class, ditentukan oleh class label attribute Kumpulan sample yang dipakai untuk model construction : training set Model direpresentasikan sebagai classification rules, decision trees, atau l formula matematis Model usage: classifying future or unknown objects Estimasi keakuratan model Label yang diketahui dari test sample dibandingkan dengan hasil klasifikasi dari model Accuracy rate = persentase dari kumpulan test sample yang diklasifikasikan dengan benar oleh model Test set bersifat independen terhadap training set Jika accuracy rate dapat diterima, pakai model untuk klasifikasi sample data yang class labelnya belum diketahui 4

Training Data Classification Algorithms NAM E RANK YEARS TENURED M ike Assistant Prof 3 no M ary Assistant Prof 7 yes Bill Professor 2 yes Jim Associate Prof 7 yes Dave Assistant Prof 6 no Anne Associate Prof 3 no Classifier (Model) IF rank = professor OR years > 6 THEN tenured = yes 5

Classifier Testing Data Unseen Data (Jeff, Professor, 4) NAME RANK YEARS TENURED Tom Assistant Prof 2 no Merlisa Associate Prof 7 no George Professor 5 yes Joseph Assistant Prof 7 yes Tenured? 6

Predictive accuracy : kemampuan model untuk memprediksi secara benar class label untuk data baru Speed : biaya komputasi untuk menghasilkan dan menggunakan model Robustness : kemampuan model untuk membuat prediksi yang benar jika terdapat noise atau missing data Scalability : kemampuan membangun model secara efisien dalam data yang berjumlah sangat besar Interpretability : tingkat pemahaman dan pengertian yang disediakan oleh model 7

Decision tree : struktur pohon, tiap internal node menyatakan sebuah test pada suatu atribut, tiap cabang menyatakan hasil test, dan node daun menyatakan class. Node paling atas adalah node akar (root). Algoritma pembentukan tree : (top down recursive, divide and conquer) Tree mulai dengan node akar Jika seluruh sample ada di class yang sama, maka node tsb menjadi leaf dan diberi label dengan class tsb. Jika tidak, gunakan information gainuntuk memilih atribut yang paling baik dalam memisahkan sample ke class. Buat cabang untuk tiap nilai dari atribut test Ulangi proses pembuatan tree sampai : Seluruh sample masuk ke class yang sama, atau Tidak terdapat lagi atribut yang dapat memisahkan data sample Tidak terdapat sample untuk cabang test atribut 8

age income student credit_rating buys_computer <=30 high no fair no <=30 high no excellent no 31 40 high no fair yes >40 medium no fair yes >40 low yes fair yes >40 low yes excellent no 31 40 low yes excellent yes <=30 medium no fair no <=30 low yes fair yes >40 medium yes fair yes <=30 medium yes excellent yes 31 40 medium no excellent yes 31 40 high yes fair yes >40 medium no excellent no 9

age? <=30 overcast 31..40 >40 student? yes credit rating? no yes excellent fair no yes yes 10

Attribute Selection Measure: Information Gain (ID3/C4.5) Pilih atribut dengan information gain tertinggi Bila p i : probabilitas sembarang tuple dalam D termasuk class C i, diestimasi sbg C i, D / D Expected information (entropy) untuk klasifikasi suatu tuple dalam D: m Info D) = p i log ( p ) ( 2 i= 1 Information (setelah memakai A utk membagi D ke dlm v v partisi) utk klasifikasi D: Dj Info A( D) = I( Dj) D Information gained dengan pencabangan pada atribut A Gain(A) = j= 1 Info(D) Info (D) A i 11

g Class P: buys_computer = yes g Class N: buys_computer = no 9 9 5 Info ( D) = I (9,5) = log ( ) log 2 14 14 14 age p i n i I(p i, n i ) <=30 2 3 0.971 31 40 4 0 0 >40 3 2 0.971 5 ( ) 14 2 = age income student credit_rating buys_computer <=30 high no fair no <=30 high no excellent no 31 40 high no fair yes >40 medium no fair yes >40 low yes fair yes >40 low yes excellent no 31 40 low yes excellent yes <=30 medium no fair no <=30 low yes fair yes >40 medium yes fair yes <=30 medium yes excellent yes 31 40 medium no excellent yes 31 40 high yes fair yes >40 medium no excellent no 0.940 5 I 14 Info age ( D) = (2,3) + 5 14 5 14 I (2,3) + I (3,2) = 4 14 0.694 I (4,0) means age <=30 has 5 out of 14 samples, with 2 yes es and 3 no s. Hence Gain( age) = Info( D) Infoage ( D) = 0.246 Similarly, Gain( income) = 0.029 Gain( student) = 0.151 Gain( credit _ rating) = 0.048 12

Classification problem klasik yang diteliti secara ekstensif oleh ahli statistik dan peneliti machine learning Scalability: klasifikasi kumpulan data dengan jutaan contoh dan ratusan atribut dengan reasonable speed Mengapa memakai decision tree induction dalam data mining? Kecepatan belajar relatif lebih tinggi (dibandingkan cara classification yang lain) Mudah diubah menjadi rule dan mudah dipahami Dapat memakai SQL query utk mengakses database Tingkat akurasinya dapat dibandingkan (comparable) dengan metoda classification yang lain 13

Bayesian classifier : statistical classifier. Dapat memprediksikan kemungkinan keanggotaan class, misalnya probabilitas suatu sample menjadi anggota suatu class tertentu. Bayesian classification didasari oleh teorema Bayes P(X H) P(H) P(H X) = ------------------------------ P(X) 14

X : data sample yang label classnya belum diketahui H : hipotesis, misalnya data sample X anggota class C. Untuk classification, kita ingin menentukan P(H X), yaitu probabilitas hipotesis H dipenuhi terhadap sample data X. P(H X) : posterior probability / posteriori probability untuk H sesuai kondisi X. Misalnya Buah, digambarkan dengan color dan shape. Jika X : red,round ; H : X adalah apel maka P(H X) : keyakinan bahwa X adalah apel karena X adalah red dan round 15

P(H) : prior probability / probability awal dari H. Mis. probabilitas bahwa data sample adalah apel, tanpa peduli bagaimana wujud sample P(X H) : posterior probability untuk X, probabilitas observasi sample X, bila hipotesis dipenuhi Mis. probabilitas X adalah red & round jika kita tahu bahwa X adalah apel. P(X) : prior probability dari X, yaitu probability bahwa sample data diobservasi Mis. probabilitas bahwa data sample adalah red & round. 16

Cara kerja naive Bayesian : Tiap data sample dengan n atribut disajikan dalam bentuk n-dimensional feature vector, X = (x 1,x 2,.,x n ) Misalkan terdapat m class, C 1,C 2, C m. Dengan data sample X, classifier akan memprediksi bahwa X adalah anggota class yang memiliki posterior probability tertinggi dengan kondisi X. 17

Sesuai teorema Bayes: P(X Ci) P(Ci) P(Ci X) = ------------------------------ P(X) Karena P(X) konstan untuk seluruh class, maka hanya P(X Ci) P(Ci) yang perlu dimaksimalkan. P(Ci) = Si/S, dengan Si adalah jumlah training sample dari class Ci, dan S adalah jumlah seluruh training sample. Karena menghitung P(X Ci) memerlukan komputasi mahal, maka dibuat asumsi yaitu bahwa tidak ada hubungan ketergantungan antar atribut. Hitung P(Xk Ci) = Sik/Si. Sik adalah jumlah training sample class Ci yang mempunyai nilai Xk, Si adalah jumlah training sample dari class Ci. 18

Class: C1:buys_computer = yes C2:buys_computer = no Data sample X = (age <=30, Income = medium, Student = yes Credit_rating = Fair) age income student credit_rating buys_c <=30 high no fair no <=30 high no excellent no 31 40 high no fair yes >40 medium no fair yes >40 low yes fair yes >40 low yes excellent no 31 40 low yes excellent yes <=30 medium no fair no <=30 low yes fair yes >40 medium yes fair yes <=30 medium yes excellent yes 31 40 medium no excellent yes 31 40 high yes fair yes >40 medium no excellent no 19

P(C i ): P(buys_computer = yes ) = 9/14 = 0.643 P(buys_computer = no ) = 5/14= 0.357 Compute P(X C i ) for each class P(age = <=30 buys_computer = yes ) = 2/9 = 0.222 P(age = <= 30 buys_computer = no ) = 3/5 = 0.6 P(income = medium buys_computer = yes ) = 4/9 = 0.444 P(income = medium buys_computer = no ) = 2/5 = 0.4 P(student = yes buys_computer = yes) = 6/9 = 0.667 P(student = yes buys_computer = no ) = 1/5 = 0.2 P(credit_rating = fair buys_computer = yes ) = 6/9 = 0.667 P(credit_rating = fair buys_computer = no ) = 2/5 = 0.4 X = (age <= 30, income = medium, student = yes, credit_rating = fair) P(X C i ) :P(X buys_computer = yes ) = 0.222 x 0.444 x 0.667 x 0.667 = 0.044 P(X buys_computer = no ) = 0.6 x 0.4 x 0.2 x 0.4 = 0.019 P(X C i )*P(C i ) : P(X buys_computer = yes ) * P(buys_computer = yes ) = 0.028 (MAX) P(X buys_computer = no ) * P(buys_computer = no ) = 0.007 Therefore, X belongs to class ( buys_computer = yes ) 20

Naïve Bayesian prediction memerlukan setiap conditional prob. harus nonzero. Jika tidak, predicted probability akan bernilai 0 P( X Ci) = n P( xk Ci) k = 1 Mis. Terdapat dataset dengan 1000 tuples, income=low (0), income= medium (990), and income = high (10), Memakai Laplacian correction ( Laplacian estimator) Tambahkan 1 pada setiap kasus Prob(income = low) = 1/1003 Prob(income = medium) = 991/1003 Prob(income = high) = 11/1003 Estimasi corrected prob. mendekati perhitungan uncorrected 21

Keuntungan Mudah diimplementasikan Memberikan hasil cukup baik pada banyak kasus Kerugian Asumsi: class conditional independence => kehilangan akurasi Secara Praktis, dependency ada di antara variabel Mis., hospitals: patients: Profile: age, family history, dll Symptoms: fever, cough, dll Disease: lung cancer, diabetes, dll Dependency antara variabel tidak dapat dimodelkan dengan Naïve Bayesian Classifier Bagaimana menangani dependency? Bayesian Belief Networks 22

Representasi pengetahuan dalam bentuk IF-THENrules R: IF age= youth AND student= yes THEN buys_computer= yes Rule antecedent/precondition vs. rule consequent Penilaian rule: coverageand accuracy n covers = # of tuples covered by R n correct = # of tuples correctly classified by R coverage(r) = n covers / D /* D: training data set */ covers accuracy(r) = n correct / n covers Jika lebih dari satu rule ditrigger, maka perlu conflict resolution Size ordering: berikan prioritas tinggi untuk rules yang bersifat toughest (mis., rule dengan most attribute test) Class-based ordering: mengurangi order dari prevalence atau misclassification cost per class Rule-based ordering (decision list): rules diorganisasi menjadi satu daftar prioritas, mengikuti ukuran kualitas rule atau saran pakar. 23

Rules lebih mudah dipahami dibandingkan tree Satu rule diciptakan untuk setiap jalur dari akar ke daun Setiap pasang attribute-value dalam suatu jalur membentuk conjunction: daun adalah class prediction Rules bersifat mutually exclusive dan exhaustive Example: Rule extraction from our buys_computerdecision-tree IFage= young AND student= no THENbuys_computer= no IFage= young AND student= yes THENbuys_computer= yes IF age = mid-age THEN buys_computer = yes IF age = old AND credit_rating = excellent THEN buys_computer = yes IF age = young AND credit_rating = fair THEN buys_computer = no age? <=30 31..40 >40 student? credit rating? yes no yes excellent fair no yes yes 24

id member age student income class:buys_funky_tshirt 1 no <=20 n high n 2 yes <=20 n high n 3 no 21.. 25 n high y 4 no 26.. 30 n medium y 5 no 26.. 30 y low y 6 yes 26.. 30 y low n 7 yes 21.. 25 y low y 8 no <=20 n medium n 9 no <=20 y low y 10 no 26.. 30 y medium y 11 yes <=20 y medium y 12 yes 21.. 25 n medium y 25

Dengan training data set tersebut, buatlah decision tree-nya. Jangan lupa sertakan langkah-langkah, perhitungan, serta pertimbangan untuk menghilangkan node tertentu (jika ada). Cari prediksi dengan naïve Bayesian classifier untuk sample X = (member=yes, age=26..30, student=no, income=high), sertakan langkah-langkah dan perhitungannya. 26