Classification using Weka (Brain, Computation, and Neural Learning)

Similar documents
An Introduction to WEKA Explorer. In part from: Yizhou Sun 2008

Prototyping DM Techniques with WEKA and YALE Open-Source Software

2. Basic Task of Pattern Classification

Assignment 1: CS Machine Learning

More Learning. Ensembles Bayes Rule Neural Nets K-means Clustering EM Clustering WEKA

Tutorial on Machine Learning Tools

Best First and Greedy Search Based CFS and Naïve Bayes Algorithms for Hepatitis Diagnosis

Classification and Regression using Linear Networks, Multilayer Perceptrons and Radial Basis Functions

ICA as a preprocessing technique for classification

WEKA homepage.

Data Mining. Lab 1: Data sets: characteristics, formats, repositories Introduction to Weka. I. Data sets. I.1. Data sets characteristics and formats

Data Mining Classification: Bayesian Decision Theory

Predicting Diabetes and Heart Disease Using Diagnostic Measurements and Supervised Learning Classification Models

AI32 Guide to Weka. Andrew Roberts 1st March 2005

Weka ( )

S2 Text. Instructions to replicate classification results.

IEE 520 Data Mining. Project Report. Shilpa Madhavan Shinde

CLASSIFICATION WITH RADIAL BASIS AND PROBABILISTIC NEURAL NETWORKS

A Systematic Overview of Data Mining Algorithms. Sargur Srihari University at Buffalo The State University of New York

Evaluating Classifiers

CS145: INTRODUCTION TO DATA MINING

Business Club. Decision Trees

Performance Evaluation of Various Classification Algorithms

Evaluating Classifiers

Study on Classifiers using Genetic Algorithm and Class based Rules Generation

Network Traffic Measurements and Analysis

Support Vector Machines

Evaluating Machine Learning Methods: Part 1

Data Mining: STATISTICA

Machine Learning Practical NITP Summer Course Pamela K. Douglas UCLA Semel Institute

Evaluating Machine-Learning Methods. Goals for the lecture

Information Management course

An Empirical Study on Lazy Multilabel Classification Algorithms

Supervised classification exercice

Retrieving and Working with Datasets Prof. Pietro Ducange

Machine Learning with MATLAB --classification

Comparative Study of Instance Based Learning and Back Propagation for Classification Problems

Data Mining With Weka A Short Tutorial

A Comparative Study of Selected Classification Algorithms of Data Mining

CANCER PREDICTION USING PATTERN CLASSIFICATION OF MICROARRAY DATA. By: Sudhir Madhav Rao &Vinod Jayakumar Instructor: Dr.

Evaluation Measures. Sebastian Pölsterl. April 28, Computer Aided Medical Procedures Technische Universität München

Predicting Bias in Machine Learned Classifiers Using Clustering

Community edition(open-source) Enterprise edition

Outline. Prepare the data Classification and regression Clustering Association rules Graphic user interface

Decision Trees In Weka,Data Formats

Assignment 2. Classification and Regression using Linear Networks, Multilayer Perceptron Networks, and Radial Basis Functions

CS249: ADVANCED DATA MINING

Neural Networks. CE-725: Statistical Pattern Recognition Sharif University of Technology Spring Soleymani

Random Forest A. Fornaser

ECE 5470 Classification, Machine Learning, and Neural Network Review

6.034 Design Assignment 2

A Lazy Approach for Machine Learning Algorithms

Bayes Risk. Classifiers for Recognition Reading: Chapter 22 (skip 22.3) Discriminative vs Generative Models. Loss functions in classifiers

Applying Supervised Learning

An Empirical Comparison of Ensemble Methods Based on Classification Trees. Mounir Hamza and Denis Larocque. Department of Quantitative Methods

Machine Learning 13. week

DATA MINING LAB MANUAL

Bagging-Based Logistic Regression With Spark: A Medical Data Mining Method

COMP s1 - Getting started with the Weka Machine Learning Toolkit

Classifiers for Recognition Reading: Chapter 22 (skip 22.3)

Artificial Intelligence. Programming Styles

WEKA: Practical Machine Learning Tools and Techniques in Java. Seminar A.I. Tools WS 2006/07 Rossen Dimov

Comparison of various classification models for making financial decisions

Performance Analysis of Data Mining Classification Techniques

Model s Performance Measures

CS6220: DATA MINING TECHNIQUES

PROJECT 1 DATA ANALYSIS (KR-VS-KP)

CS570: Introduction to Data Mining

Evaluation Metrics. (Classifiers) CS229 Section Anand Avati

INTRODUCTION TO MACHINE LEARNING. Measuring model performance or error

COMPARISON OF DIFFERENT CLASSIFICATION TECHNIQUES

Polytechnic University of Tirana

Data Mining and Knowledge Discovery Practice notes 2

More on Learning. Neural Nets Support Vectors Machines Unsupervised Learning (Clustering) K-Means Expectation-Maximization

Decision Trees Using Weka and Rattle

A Comparison of Decision Tree Algorithms For UCI Repository Classification

Large Scale Data Analysis Using Deep Learning

Predictive modelling / Machine Learning Course on Big Data Analytics

Predicting Diabetes using Neural Networks and Randomized Optimization

Artificial Neural Networks (Feedforward Nets)

Data Mining and Knowledge Discovery: Practice Notes

Research on Applications of Data Mining in Electronic Commerce. Xiuping YANG 1, a

Available online at ScienceDirect. Procedia Computer Science 35 (2014 )

Univariate Margin Tree

A Systematic Overview of Data Mining Algorithms

Noise-based Feature Perturbation as a Selection Method for Microarray Data

Subject. Dataset. Copy paste feature of the diagram. Importing the dataset. Copy paste feature into the diagram.

The Explorer. chapter Getting started

Interpretation and evaluation

A Comparative Study of Locality Preserving Projection and Principle Component Analysis on Classification Performance Using Logistic Regression

MIT Samberg Center Cambridge, MA, USA. May 30 th June 2 nd, by C. Rea, R.S. Granetz MIT Plasma Science and Fusion Center, Cambridge, MA, USA

Supervised Learning with Neural Networks. We now look at how an agent might learn to solve a general problem by seeing examples.

The Mathematics Behind Neural Networks

Author Prediction for Turkish Texts

Machine Learning Techniques for Data Mining

Classification of Subject Motion for Improved Reconstruction of Dynamic Magnetic Resonance Imaging

INTRODUCTION TO DATA MINING. Daniel Rodríguez, University of Alcalá

Keras: Handwritten Digit Recognition using MNIST Dataset

Data Mining Classification: Alternative Techniques. Imbalanced Class Problem

Why MultiLayer Perceptron/Neural Network? Objective: Attributes:

Transcription:

LOGO Classification using Weka (Brain, Computation, and Neural Learning) Jung-Woo Ha

Agenda Classification General Concept Terminology Introduction to Weka Classification practice with Weka Problems: Pima Indians diabetes, handwritten digit recognition Algorithms: Neural Networks, Decision Trees, Support Vector Machines Evaluation criteria Using Experimenter for batch experiments Building committee machine Mini-project 2

Machine Classification Sorting fish on a conveyor belt: Salmon ( 연어 ) vs. sea bass ( 농어 ) set up a camera, take images and use some physical differences (length, lightness, width, fin shape, mouth position, etc) to explore. 3

Concept of Classification <Notations> n = # training examples x = input variables (features or attributes) y = output variable / target variable (x, y) training example The i-th training example = (x (i), y (i) ) Training Set Learning Algorithm Input features h Output / prediction e.g. pixels in a picture of handwritten digit f (x) w hypothesis w x 0 1 1 w x n n 3 or 8 4

Terminology Features or Attributes Features are the individual measurable properties of the phenomena being observed Choosing discriminating and independent features is key to any pattern recognition algorithm being successful in classification Training set / Test set Training set: A set of examples used for learning, that is to fit the parameters [i.e., weights] of the classifier Test set: A set of examples used only to assess the performance [generalization] of a fully-specified classifier 5

Introduction to Weka Weka: Data Mining Software in Java Weka is a collection of machine learning algorithms for data mining & machine learning tasks What you can do with Weka? data pre-processing, feature selection, classification, regression, clustering, association rules, and visualization Weka is an open source software issued under the GNU General Public License How to get? http://www.cs.waikato.ac.nz/ml/weka/ or just type Weka in google. 6

Dataset #1: Pima Indians Diabetes Description Pima Indians have the highest prevalence of diabetes in the world We will build classification models that diagnose if the patient shows signs of diabetes http://archive.ics.uci.edu/ml/datasets/pima+indians+diabetes Configuration of the data set 768 instances 8 attributes age, number of times pregnant, results of medical tests/analysis all numeric (integer or real-valued) Also, a discretized set will be provided Class value = 1 (Positive example ) Interpreted as "tested positive for diabetes" 500 instances Class value = 0 (Negative example) 268 instances 7

Dataset #2: Handwritten Digits (MNIST) Description The MNIST database of handwritten digits contains digits written by office workers and students We will build a recognition model based on classifiers with the reduced set of MNIST http://yann.lecun.com/exdb/mnist/ Configuration of the data set Attributes pixel values in gray level in a 28x28 image 784 attributes (all 0~255 integer) Full MNIST set Training set: 60,000 examples Test set: 10,000 examples For our practice, a reduced set with 800 examples is used Class value: 0~9, which represent digits from 0 to 9 8

Artificial Neural Networks MLP (Multilayer Perceptron) In Weka, Classifiers-functions-MultilayerPerceptron 9

Artificial Neural Networks Reviews on BP algorithm The Number of iterations The number of hidden layers and hidden nodes Learning rate Momentum : Four main parameters for learning MLPs 10

Reviews on MLPs Expression power of MLPs 11

Decision Trees J48 (Java implementation of C4.5) In Weka, classifiers-trees-j48 12

Support Vector Machines SMO (sequential minimal optimization) for training SVM In Weka, classifiers-functions-smo 13

Practice Basic Comparing the performances of algorithms MultilayerPerceptron vs. J48 vs. SVM Checking the trained model (structure & parameter) Tuning parameters to get better models Understanding Test options & Classifier output in Weka Advanced Building committee machines using meta algorithms for classification Preprocessing / data manipulation applying Filter Batch experiment with Experimenter Design & run a batch process with KnowledgeFlow 14

Dataset for Practice with Weka Pima Indians diabetes Original data: pima_diabetes.arff Discretized data: pima_diabetes_supervised_discretized.arff Handwritten Digit (MNIST) Training/test pair mnist_reduced_training.arff, mnist_reduced_test.arff 800 & 200 instances, respectively Total set (1,000 instances) mnist_reduced_total.arff Can be used for cross-validation 15

Data format for Weka (.ARFF) @relation heart-disease-simplified Header Data (CSV format) @attribute age numeric @attribute sex { female, male} @attribute chest_pain_type { typ_angina, asympt, non_anginal, atyp_angina} @attribute cholesterol numeric @attribute exercise_induced_angina { no, yes} @attribute class { present, not_present} @data 63,male,typ_angina,233,no,not_present 67,male,asympt,286,yes,present 67,male,asympt,229,yes,present 38,female,non_anginal,?,no,not_present Note: You can easily generate arff file by adding a header to a usual CSV text file 16

Neural Networks in Weka click load a file that contains the training data by clicking Open file button ARFF or CSV formats are readible Click MultilayerPerceptron Set parameters for MLP Set parameters for Test Click Start for learning Click Classify tab Click Choose button Select weka function - MultilayerPerceptron 17

Some Notes on the Parameter Setting Parameter Setting = Car Tuning need much experience or many times of trial you may get worse results if you are unlucky Multilayer Perceptron (MLP) Main parameters for learning: hiddenlayers, learningrate, momentum, trainingtime (epoch), seed J48 Main parameters: unpruned, numfolds, minnumobj Many parameters are for controlling the size of the result tree, i.e. confidencefactor, pruning SMO (SVM) Main parameters: c (complexity parameter), kernel, kernel parameters 18

Test Options and Classifier Output Setting the data set used for evaluation There are various metrics for evaluation 19

How to Evaluate the Performance? (1/2) Usually, build a Confusion Matrix out of given data Evaluation Metrics Accuracy (percent correct) Precision Recall Many other metrics: F-measure, Kappa score, etc. For fare evaluation, the cross-validation scheme is used 20

How to Evaluate the Performance? (2/2) Confusion Matrix Real Prediction Positive Negative Positive TP FP Negative FN TN All with positive Test All with Negative Test All with Disease All without Disease Everyone Accuracy Precision TP TN TP FP TN FN TP TP FP Recall TP TP FN As recall precision conversely: As recall precision 21

Evaluation Method - Cross Validation K-fold Cross Validation The data set is randomly divided into k subsets. One of the k subsets is used as the test set and the other k-1 subsets are put together to form a training set. k 6-fold cross validation Error D 1 D 2 D 3 D 4 D 5 D 6 128 128 128 128 128 128 D 1 D 2 D 3 D 4 D 6 D 5 128 128 128 128 128 128 1 k i 1 Error i D 2 D 3 D 4 D 5 D 6 D 1 128 128 128 128 128 128 22

Committee Machine in Weka Using committee machine / ensemble learning in Weka Boosting: AdaBoostM1 Voting committee: Vote Bagging 23

Data Manipulation with Filter in Weka Attribute Selection, discretize Instance Re-sampling, selecting specified folds 24

Using Experimenter in Weka Tool for Batch experiments Click New click Select Run tab and click Start If it has finished successfully, click Analyse tab and see the summary Set experiment type/iteration control Set datasets / algorithms 25

KnowledgeFlow for Analysis Process Design ( Process Flow Diagram of SAS Enterprise Miner ) 26

References Weka Wiki: http://weka.wikispaces.com/ Weka online documentation: http://www.cs.waikato.ac.nz/ml/weka/index_documentation.html Textbooks Tom Mitchell (1997) Machine Learning, McGraw Hill Christopher M. Bishop (2006) Pattern Recognition and Machine Learning, Springer Richard O. Duda, Peter E. Hart, David G. Stork (2001) Pattern classification (2nd edition), Wiley, New York 27

Mini-project Make an arff file Make a csv file with MS Excel. Open the csv file with Weka Save the csv file as an arff file Modify the property value of class to discrete value set with any text editor program Save the arff file Reload the arff file with Weka 28

Mini-project click load a file that contains the training data by clicking Open file button ARFF or CSV formats are readible Click MultilayerPerceptron Set parameters for MLP Set parameters for Test Click Start for learning Click Classify tab Click Choose button Select weka function - MultilayerPerceptron 29

Mini-project Parameter setting of MLPs More explanations on the parameters 30

Test Options and Classifier Output Setting the data set used for evaluation There are various metrics for evaluation 31

Mini-project Make a MLP by yourself with GUI option You can make the hidden layers by yourself. When clicking more button, you can get details of explanation for GUI. 32

Mini-project J48 33

Mini-project Experiments Convenient comparisons on data and methods 34

Experiments 35

Mini-project Classification problem with Weka Data set 3 different data sets You should include at least one set from UCI ML repository and MNIST set (http://archive.ics.uci.edu/ml/) Classification methods MLP: iters, learning rate, momentum, # of hidden nodes SVM: will be addressed in next time J48: Default options only 36

Mini term-project Contents in the report You should compare the results of various parameter settings for MLPs find optimal parameter setting for MLP and report the classification performance on that setting on all data sets Compare the best MLP result to the result of J48 on three data sets (classification and time) Include discussions At most A4 four pages Due date: 24th Nov. 2011(302-314-1) 37