Machine Learning with WEKA

Slides:



Advertisements
Similar presentations
Department of Computer Science, University of Waikato, New Zealand Eibe Frank WEKA: A Machine Learning Toolkit The Explorer Classification and Regression.
Advertisements

Florida International University COP 4770 Introduction of Weka.
Weka & Rapid Miner Tutorial By Chibuike Muoh. WEKA:: Introduction A collection of open source ML algorithms – pre-processing – classifiers – clustering.
Department of Computer Science, University of Waikato, New Zealand Eibe Frank WEKA: A Machine Learning Toolkit The Explorer Classification and Regression.
UNIVERSITY OF JYVÄSKYLÄ DEPARTMENT OF MATHEMATICAL INFORMATION TECHNOLOGY Tutorial 1: Introduction to WEKA and YALETIES443: Introduction to DM 1 Tutorial.
WEKA Evaluation of WEKA Waikato Environment for Knowledge Analysis Presented By: Manoj Wartikar & Sameer Sagade.
Department of Computer Science, University of Waikato, New Zealand Eibe Frank WEKA: A Machine Learning Toolkit The Explorer Classification and Regression.
March 25, 2004Columbia University1 Machine Learning with Weka Lokesh S. Shrestha.
An Extended Introduction to WEKA. Data Mining Process.
1 Statistical Learning Introduction to Weka Michel Galley Artificial Intelligence class November 2, 2006.
Machine Learning with WEKA. WEKA: the bird Copyright: Martin Kramer
1 How to use Weka How to use Weka. 2 WEKA: the software Waikato Environment for Knowledge Analysis Collection of state-of-the-art machine learning algorithms.
CSCI 347 / CS 4206: Data Mining Module 05: WEKA Topic 04: Data Preparation Tools.
CSCI 347 / CS 4206: Data Mining Module 05: WEKA Topic 01: WEKA Navigation.
 The Weka The Weka is an well known bird of New Zealand..  W(aikato) E(nvironment) for K(nowlegde) A(nalysis)  Developed by the University of Waikato.
Contributed by Yizhou Sun 2008 An Introduction to WEKA.
Department of Computer Science, University of Waikato, New Zealand Geoff Holmes WEKA project and team Data Mining process Data format Preprocessing Classification.
WEKA - Explorer (sumber: WEKA Explorer user Guide for Version 3-5-5)
WEKA and Machine Learning Algorithms. Algorithm Types Classification (supervised) Given -> A set of classified examples “instances” Produce -> A way of.
Appendix: The WEKA Data Mining Software
In part from: Yizhou Sun 2008 An Introduction to WEKA Explorer.
Department of Computer Science, University of Waikato, New Zealand Bernhard Pfahringer (based on material by Eibe Frank, Mark Hall, and Peter Reutemann)
Department of Computer Science, University of Waikato, New Zealand Eibe Frank WEKA: A Machine Learning Toolkit The Explorer Classification and Regression.
Machine Learning with Weka Cornelia Caragea Thanks to Eibe Frank for some of the slides.
Weka: Experimenter and Knowledge Flow interfaces Neil Mac Parthaláin
For ITCS 6265/8265 Fall 2009 TA: Fei Xu UNC Charlotte.
W E K A Waikato Environment for Knowledge Analysis Branko Kavšek MPŠ Jožef StefanNovember 2005.
1 1 Slide Using Weka. 2 2 Slide Data Mining Using Weka n What’s Data Mining? We are overwhelmed with data We are overwhelmed with data Data mining is.
Department of Computer Science, University of Waikato, New Zealand Eibe Frank WEKA: A Machine Learning Toolkit The Explorer Classification and Regression.
Weka – A Machine Learning Toolkit October 2, 2008 Keum-Sung Hwang.
Introduction to Weka Xingquan (Hill) Zhu Slides copied from Jeffrey Junfeng Pan (UST)
 A collection of open source ML algorithms ◦ pre-processing ◦ classifiers ◦ clustering ◦ association rule  Created by researchers at the University.
W E K A Waikato Environment for Knowledge Aquisition.
***Classification Model*** Hosam Al-Samarraie, PhD. CITM-USM.
Introduction to Weka ML Seminar for Rookies Byoung-Hee Kim Biointelligence Lab, Seoul National University.
Weka Tutorial. WEKA:: Introduction A collection of open source ML algorithms – pre-processing – classifiers – clustering – association rule Created by.
Weka. Weka A Java-based machine vlearning tool Implements numerous classifiers and other ML algorithms Uses a common.
Machine Learning (ML) with Weka Weka can classify data or approximate functions: choice of many algorithms.
Machine Learning with WEKA - Yohan Chin. WEKA ? Waikato Environment for Knowledge Analysis A Collection of Machine Learning algorithms for data tasks.
In part from: Yizhou Sun 2008 An Introduction to WEKA Explorer.
@relation age sex { female, chest_pain_type { typ_angina, asympt, non_anginal,
WEKA: A Practical Machine Learning Tool WEKA : A Practical Machine Learning Tool.
Department of Computer Science, University of Waikato, New Zealand Eibe Frank WEKA: A Machine Learning Toolkit The Explorer Classification and Regression.
Department of Computer Science, University of Waikato, New Zealand Geoff Holmes WEKA project and team Data Mining process Data format Preprocessing Classification.
An Introduction to WEKA
Machine Learning: Decision Trees in AIMA and WEKA
An Introduction to WEKA
Machine Learning: Decision Trees in AIMA and WEKA
Waikato Environment for Knowledge Analysis
WEKA.
Sampath Jayarathna Cal Poly Pomona
An Introduction to WEKA
Figure 1.1 Rules for the contact lens data.
Machine Learning with WEKA
Machine Learning with WEKA
Weka Package Weka package is open source data mining software written in Java. Weka can be applied to your dataset from the GUI, the command line or called.
Machine Learning with Weka
An Introduction to WEKA
DataMining, Morgan Kaufmann, p Mining Lab. 김완섭 2004년 10월 27일
Tutorial for WEKA Heejun Kim June 19, 2018.
Machine Learning with Weka
Machine Learning with WEKA
Lecture 10 – Introduction to Weka
Statistical Learning Introduction to Weka
Copyright: Martin Kramer
Machine Learning: Decision Trees in AIMA and WEKA
Neural Networks Weka Lab
Data Mining CSCI 307, Spring 2019 Lecture 7
Data Mining CSCI 307, Spring 2019 Lecture 8
Presentation transcript:

Machine Learning with WEKA

Copyright: Martin Kramer (mkramer@wxs.nl) WEKA: the bird Copyright: Martin Kramer (mkramer@wxs.nl) 2018/9/15 University of Waikato

WEKA: the software Machine learning/data mining software written in Java (distributed under the GNU Public License) Used for research, education, and applications Complements “Data Mining” by Witten & Frank Main features: Comprehensive set of data pre-processing tools, learning algorithms and evaluation methods Graphical user interfaces (incl. data visualization) Environment for comparing learning algorithms 2018/9/15 University of Waikato

WEKA: versions There are several versions of WEKA: WEKA 3.0: “book version” compatible with description in data mining book WEKA 3.2: “GUI version” adds graphical user interfaces (book version is command-line only) WEKA 3.3: “development version” with lots of improvements This talk is based on WEKA 3.4 WEKA 3.x 2018/9/15 University of Waikato

WEKA only deals with “flat” files @relation heart-disease-simplified @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 ... Flat file in ARFF format 2018/9/15 University of Waikato

WEKA only deals with “flat” files @relation heart-disease-simplified @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 ... numeric attribute nominal attribute class attribute 2018/9/15 University of Waikato

2018/9/15 University of Waikato 7

Explorer: pre-processing the data Data can be imported from a file in various formats: ARFF, CSV, C4.5, binary Data can also be read from a URL or from an SQL database (using JDBC) Pre-processing tools in WEKA are called “filters” WEKA contains filters for: Discretization, normalization, attribute selection , resampling, transforming and combining attributes, … 2018/9/15 University of Waikato

3 1 2 5 4 Find your data folder open iris.arff data set make sure file extension is .arff 2018/9/15 University of Waikato

The iris Dataset (鳶尾花資料集) Sources (Perhaps the best known dataset in pattern recognition) Creator: R.A. Fisher Donor: Michael Marshall Date: July, 1988 Number of Instances: 150 (50 in each of 3 classes) Number of Input Attributes: 4, numeric Missing Attribute Values: None Attribute Information sepal length (in cm) 花萼長度 sepal width (in cm) petal length (in cm) 花瓣長度 petal width (in cm) class: iris Setosa, iris Versicolour, iris Virginica (3 classes) 2018/9/15 10

鳶尾花經典分類 Iris Versicolour Iris Setosa Iris Virginica 2018/9/15 11

鳶尾花(iris, 愛麗絲) 科別:鳶尾科多年生草本 生長適溫約攝氏20~28度 特性: iris源於希臘語,意思是彩虹 有根莖鳶尾和球莖鳶尾之分 高30~40公分 葉劍形帶狀 三片花瓣,多為藍或紫色 三片花蕚,多為藍或紫色 《鳶尾花》是梵谷的知名作品之一 2018/9/15 12

鳶尾花 三片花瓣為白色,三片花萼為藍紫褐色 花莖外形與葉片相似 叢生,葉為細劍形 2018/9/15 13

2018/9/15 University of Waikato University of Waikato

Save as other file format as needed 2018/9/15 University of Waikato

2018/9/15 University of Waikato University of Waikato

2018/9/15 University of Waikato

Choose petallength 2018/9/15 University of Waikato

click 2018/9/15 University of Waikato University of Waikato

click 2018/9/15 University of Waikato University of Waikato

Click to change parameters 2018/9/15 University of Waikato University of Waikato

2018/9/15 University of Waikato University of Waikato

Click to read more description 2018/9/15 University of Waikato University of Waikato

2018/9/15 University of Waikato University of Waikato

2018/9/15 University of Waikato University of Waikato

2018/9/15 University of Waikato University of Waikato

Explorer: building “classifiers” Classifiers in WEKA are models to predict nominal or numeric quantities for a dependent variable Implemented learning schemes include: Decision trees, instance-based classifiers, support vector machines, multi-layer perceptrons, logistic regression, Bayes’ nets, … 2018/9/15 University of Waikato

1 2 2018/9/15 University of Waikato

1 2 2018/9/15 University of Waikato

Click to change parameters 2018/9/15 University of Waikato

2018/9/15 University of Waikato

1 2 2018/9/15 University of Waikato

2018/9/15 University of Waikato

2018/9/15 University of Waikato

2018/9/15 University of Waikato

2018/9/15 University of Waikato

2018/9/15 University of Waikato

2018/9/15 University of Waikato

2018/9/15 University of Waikato

Scroll to see other results 2018/9/15 University of Waikato

2018/9/15 University of Waikato

Right click 2018/9/15 University of Waikato

2018/9/15 University of Waikato

Right click 2018/9/15 University of Waikato

2018/9/15 University of Waikato

Click to change Y coordinate Click to change Y coordinate Classification errors 2018/9/15 University of Waikato

2018/9/15 University of Waikato

1 2 2018/9/15 University of Waikato

2018/9/15 University of Waikato

2018/9/15 University of Waikato

2 1 output neurons 2018/9/15 University of Waikato 51

1 2 hidden neurons & connection weights 2018/9/15 University of Waikato 52

2 1 Click to change parameters input neurons & connection weights 2018/9/15 University of Waikato 53

1 2 3 2018/9/15 University of Waikato

2018/9/15 University of Waikato 55

1 2 2018/9/15 University of Waikato

2018/9/15 University of Waikato

2018/9/15 University of Waikato

2018/9/15 University of Waikato

2018/9/15 University of Waikato

2018/9/15 University of Waikato

ROC curve 2018/9/15 University of Waikato

Use a numeric attribute as output 2018/9/15 University of Waikato

Choose petallength 2018/9/15 University of Waikato 64

2018/9/15 University of Waikato

1 2 Use M5P to predict petal length of a iris flower M5 Model trees and rules: Combines a decision tree with linear regression 2018/9/15 University of Waikato

3 1 2 When to use model 1, 2, 3 Model 1 Model 2 Model 3 Generate 3 models 2018/9/15 University of Waikato

Linear Model 1 Linear Model 2 Linear Model 3 2018/9/15 University of Waikato

right click “Visualize classifier error” performance evaluation right click “Visualize classifier error” 2018/9/15 University of Waikato

Click a data point to show the data window 2018/9/15 University of Waikato

2018/9/15 University of Waikato

2 1 choose right click 2018/9/15 University of Waikato 72

2018/9/15 University of Waikato 73

Explorer: clustering data WEKA contains “clusterers” for finding groups of similar instances in a dataset Implemented schemes are: k-Means, EM, Cobweb, X-means, FarthestFirst Clusters can be visualized and compared to “true” clusters (if given) 2018/9/15 University of Waikato

1 2 2018/9/15 University of Waikato

2018/9/15 University of Waikato

3 1 2 2018/9/15 University of Waikato

Enter 3 clusters 2018/9/15 University of Waikato

2018/9/15 University of Waikato

Clusters can be compared to “true” clusters (if given) 2018/9/15 University of Waikato

Scroll down 2018/9/15 University of Waikato

2018/9/15 University of Waikato

Right click 2018/9/15 University of Waikato

2018/9/15 University of Waikato

Incorrectly classified instances Click to change Y coordinate Click to change Y coordinate Incorrectly classified instances 2018/9/15 University of Waikato

Explorer: finding associations WEKA contains an implementation of the Apriori algorithm for learning association rules Works only for discrete (categorical) data Can identify statistical dependencies between groups of attributes: milk, butter  bread, eggs (with confidence 0.9 and support 2000) Apriori can compute all rules that have a given minimum support and exceed a given confidence 2018/9/15 University of Waikato

2018/9/15 University of Waikato

2018/9/15 University of Waikato

Load vote data set 2018/9/15 University of Waikato

The Congressional Voting Records Dataset (美國國會選舉資料集) Sources (Date: April, 1987) Origin : Congressional Quarterly Almanac, 98th Congress, 2nd session 1984 Donor: Jeff Schlimmer Area : Social Data Set Characteristics : Multivariate Associated Task : Classification Number of Instances: 435 Number of Input Attributes: 16, Categorical Number of classes : 2 (Republican or Democrat) Missing Attribute Values: Yes An unknown value is encoded as ? 2018/9/15 90

The soybean-large Dataset (黃豆資料集) Sources (Date: July, 1988) Origin : R.S. Michalski and R.L. Chilausky Donor: Ming Tan & Jeff Schlimmer Purpose : for soybean disease diagnosis Data Set Characteristics : Multivariate Associated Task : Classification Number of Instances: 307 Number of Input Attributes: 35, Categorical The values for attributes are encoded numerically Number of classes : 19 Only the first 15 of which have been used in prior work (The last 4 classes only have 17 records totally) Missing Attribute Values: Yes An unknown value is encoded as ? 2018/9/15 91

WEKA’s Association Mining Module Only Deals with Nominal Attribute @relation heart-disease-simplified @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 ... numeric attribute nominal attribute class attribute 2018/9/15 University of Waikato 92

WEKA’s Association Mining Module Can’t Be Started with Numeric Attributes @relation soybean-large-processed @attribute date {0,1,2,3,4,5,6} @attribute plant-stand {0,1} @attribute precip {0,1,2} @attribute temp {0,1,2} @attribute hail {0,1} @attribute crop-hist {0,1,2,3} @attribute area-damaged {0,1,2,3} @attribute severity {0,1,2} ……… @data 6,0,2,1,0,1,1,1,0,0,1,1,0,2,2,0,0,0,1,1,3,1,1,1,0,0,0,0,4,0,0,0,0,0,0,diaporthe-stem-canker 4,0,2,1,0,2,0,2,1,1,1,1,0,2,2,0,0,0,1,0,3,1,1,1,0,0,0,0,4,0,0,0,0,0,0,diaporthe-stem-canker nominal attributes (encoded numerically) 2018/9/15 University of Waikato 93

2018/9/15 University of Waikato

click 2018/9/15 University of Waikato

Expand the Window 2018/9/15 University of Waikato

2 minimum support = 0.45 minimum confidence = 0.9 Change parameters item support count rule confidence 2018/9/15 University of Waikato 97 Default : 10 rules

minimum support minimum confidence Set number of rules=15 2018/9/15 University of Waikato 98

click 15 rules 2018/9/15 University of Waikato

Explorer: attribute selection Panel that can be used to investigate which (subsets of) attributes are the most predictive ones Attribute selection methods contain two parts: A search method: best-first, forward selection, random, exhaustive, genetic algorithm, ranking An evaluation method: correlation-based, wrapper, information gain, chi-squared, … Very flexible: WEKA allows (almost) arbitrary combinations of these two 2018/9/15 University of Waikato 100

1 2 2018/9/15 University of Waikato

2018/9/15 University of Waikato

2018/9/15 University of Waikato

2018/9/15 University of Waikato

2018/9/15 University of Waikato

2018/9/15 University of Waikato

2018/9/15 University of Waikato

Explorer: data visualization Visualization is very useful in practice, e.g. helps to determine difficulty of the learning problem WEKA can visualize single attributes (1D) and pairs of attributes (2D) Color-coded class values “Jitter” option to deal with nominal attributes (and to detect “hidden” data points) “Zoom-in” function 2018/9/15 University of Waikato

1 Load Glass data set 2 2018/9/15 University of Waikato

2018/9/15 University of Waikato

2 1 Change PointSize 2018/9/15 University of Waikato

2018/9/15 University of Waikato

2 1 Change PlotSize 2018/9/15 University of Waikato 113

Window size is changed when PlotSize is changed 2018/9/15 University of Waikato

Double click to enlarge 2018/9/15 University of Waikato 115

2018/9/15 University of Waikato

2018/9/15 University of Waikato

1 1 3 2 Choose Rectangle Zoom-in Click and drag to choose a bolck of data 2 2018/9/15 University of Waikato

2018/9/15 University of Waikato

2018/9/15 University of Waikato

Performing experiments Experimenter makes it easy to compare the performance of different learning schemes For classification and regression problems Results can be written into file or database Evaluation options: cross-validation, learning curve, hold-out Can also iterate over different parameter settings Significance-testing is built in! 2018/9/15 University of Waikato

Click 2018/9/15 University of Waikato

Click 2018/9/15 University of Waikato

1. Set up parameters 2. Add a few data sets 3. Add a few algorithms 2018/9/15 University of Waikato

2018/9/15 University of Waikato

2018/9/15 University of Waikato

Result message Running status 2018/9/15 University of Waikato

2018/9/15 University of Waikato

2018/9/15 University of Waikato

2018/9/15 University of Waikato

2018/9/15 University of Waikato

2018/9/15 University of Waikato

2018/9/15 University of Waikato

The Knowledge Flow GUI New graphical user interface for WEKA Java-Beans-based interface for setting up and running machine learning experiments Data sources, classifiers, etc. are beans and can be connected graphically Data “flows” through components: e.g., “data source” -> “filter” -> “classifier” -> “evaluator” Layouts can be saved and loaded again later 2018/9/15 University of Waikato

2018/9/15 University of Waikato

2018/9/15 University of Waikato

2018/9/15 University of Waikato

2018/9/15 University of Waikato

2018/9/15 University of Waikato

2018/9/15 University of Waikato

2018/9/15 University of Waikato

2018/9/15 University of Waikato

2018/9/15 University of Waikato

Can continue this... 2018/9/15 University of Waikato

2018/9/15 University of Waikato

2018/9/15 University of Waikato

2018/9/15 University of Waikato

2018/9/15 University of Waikato

2018/9/15 University of Waikato

2018/9/15 University of Waikato

2018/9/15 University of Waikato

2018/9/15 University of Waikato

2018/9/15 University of Waikato

2018/9/15 University of Waikato

Conclusion: try it yourself! WEKA is available at http://www.cs.waikato.ac.nz/ml/weka Also has a list of projects based on WEKA WEKA contributors: Abdelaziz Mahoui, Alexander K. Seewald, Ashraf M. Kibriya, Bernhard Pfahringer , Brent Martin, Peter Flach, Eibe Frank ,Gabi Schmidberger ,Ian H. Witten , J. Lindgren, Janice Boughton, Jason Wells, Len Trigg, Lucio de Souza Coelho, Malcolm Ware, Mark Hall ,Remco Bouckaert , Richard Kirkby, Shane Butler, Shane Legg, Stuart Inglis, Sylvain Roy, Tony Voyle, Xin Xu, Yong Wang, Zhihai Wang 2018/9/15 University of Waikato