Upcoming SlideShare
×

# Introduction to data mining with Weka by OPEN MINER

2,165 views

Published on

Introduction to data mining with WEKA by OPEN MINER
www.open-miner.com

Published in: Technology
1 Like
Statistics
Notes
• Full Name
Comment goes here.

Are you sure you want to Yes No
• Be the first to comment

Views
Total views
2,165
On SlideShare
0
From Embeds
0
Number of Embeds
3
Actions
Shares
0
123
0
Likes
1
Embeds 0
No embeds

No notes for slide

### Introduction to data mining with Weka by OPEN MINER

1. 1. AN INTRODUCTION TO DATA MINING WITH WEKA BY OPEN MINER WWW.OPEN-MINER.COM Part 0 About Us
2. 2. Instructors 2   Japan Advance Institute of Science and Technology  Computer Engineering  Computer Engineering Email: siriwont@gmail.com, openminer@gmail.c om Open Miner Intelligence : http://www.open-miner.com AN INTRODUCTION TO DATA MINING WITH WEKA 
3. 3. Course Outline 3  1st day  Introduction to data mining  Introduction to Weka OPEN MINER  Preprocess www.open-miner.com  Regression & Classification Techniques www.facebook.com/openmin  Linear Regression  Decision tree er Open Miner Intelligence : http://www.open-miner.com AN INTRODUCTION TO DATA MINING WITH WEKA
4. 4. Course Outline (cont’) 4  2nd day  Regression    & Classification Techniques K-Nearest neighbors Neural Networks Support Vector Machines (SVM) OPEN MINER  Clustering www.open-miner.com Association rule discovery www.facebook.com/openmin  JAVA + WEKA  PHP + WEKA er  Knowledge Flow  Open Miner Intelligence : http://www.open-miner.com AN INTRODUCTION TO DATA MINING WITH WEKA
5. 5. AN INTRODUCTION TO DATA MINING WITH WEKA BY OPEN MINER WWW.OPEN-MINER.COM Part I Introduction to Data Mining
6. 6. What is data mining? 6  “The exploration and analysis of large quantities of data in order to discover meaningful patterns and rules” – Data Mining Techniques (2nd Edition) OPEN MINER(patterns) (relation) www.open-miner.com  www.facebook.com/openmin “Extraction of interesting (noner trivial, previously, unknown and potential  useful) information from data in large databases” – Data Mining Concepts &Techniques (2 Edition) Open Miner Intelligence : http://www.open-miner.com nd AN INTRODUCTION TO DATA MINING WITH WEKA
7. 7. Loyalty Cards 7 OPEN MINER www.open-miner.com www.facebook.com/openmin er Open Miner Intelligence : http://www.open-miner.com AN INTRODUCTION TO DATA MINING WITH WEKA
8. 8. Loyalty Cards (2) 8 Tesco Lotus Club card 08/2552 BigC BigCard 09/2552 Carrefou r I wish 2550 TOPS OPEN MINER www.open-miner.com SPOT ~2548 www.facebook.com/openmin personal er positioning shopping Reference : list Open Miner Intelligence : http://www.open-miner.com AN INTRODUCTION TO DATA MINING WITH WEKA
9. 9. Summary 9         OPEN MINER www.open-miner.com Social network : facebook, twitter protein sequence, gene Data mining www.facebook.com/openmin er  Open Miner Intelligence : http://www.open-miner.com  AN INTRODUCTION TO DATA MINING WITH WEKA
10. 10. AN INTRODUCTION TO DATA MINING WITH WEKA BY OPEN MINER WWW.OPEN-MINER.COM Part II Cross Reference Industry Standard Process for Data Mining
11. 11. CRISP-DM 11  CRoss-Industry Standard Process for Data Mining (CRISP-DM)  OPEN MINER www.open-miner.com DaimlerChrysler  SPSS  NCR www.facebook.com/openmin  Workflow data mining  6 er  Open Miner Intelligence : http://www.open-miner.com AN INTRODUCTION TO DATA MINING WITH WEKA
12. 12. Data Mining Workflow 12 : http://openminer.com/2009/11/03/introduction-datamining/  Business Understanding + Data Understanding + Data Preparation 80% OPEN MINER www.open-miner.com www.facebook.com/openmin er Open Miner Intelligence : http://www.open-miner.com AN INTRODUCTION TO DATA MINING WITH WEKA
13. 13. CRISP Example 13  ( http://www.nectec.or.th/NTJ/No11/No11.php )    OPEN MINER www.open-miner.com www.facebook.com/openmin er Open Miner Intelligence : http://www.open-miner.com AN INTRODUCTION TO DATA MINING WITH WEKA
14. 14. CRISP Example (5) 14  Stu_c ode Sex Addr GPA ess 370580 63 Male Bangk ok Data Understanding  2535-2542 2.3 OPEN MINER 10,000 370581 Male Songk 3.2 476,085 67 www.open-miner.com la   …. … … … 2  Sub_co … Grad www.facebook.com/openmin de e 370580 … C+er Stu_c ode 63 370580 … D 63 Open Miner Intelligence : http://www.open-miner.com   1 9 AN INTRODUCTION TO DATA MINING WITH WEKA
15. 15. CRISP Example (6) 15 Old New Stu_c ode Sex Addr GPA ess Stu_c ode Sex Addr GPA ess 370580 63 Male Bangk ok 370580 63 Male Bangk ok 370581 67 …. 2.3 OPEN MINER Male Songk 3.2 370581 Male Songk www.open-miner.com la la Old) 67 … … … …. … … BAD GOO D (Ne … … Grad Stu_c Sub_co … www.facebook.com/openminGrad e ode de e 370580 … C+ er 370580 … Mediu Stu_c Sub_co ode de 63 370580 … D 63 Open Miner Intelligence : http://www.open-miner.com 63 m 370580 … Low 63 INTRODUCTION TO DATA MINING WITH WEKA AN
16. 16. Data Mining Concepts and Techniques 16 Supervised learning Unsupervised learning   Classification    Clustering OPEN MINER www.open-miner.com   Associate www.facebook.com/openmin Regression er    Open Miner Intelligence : http://www.open-miner.com   AN INTRODUCTION TO DATA MINING WITH WEKA
17. 17. Data Mining Software 17  Commercial Software  SAS® Enterprise Miner  Open source software or Freeware    Weka OPEN MINER www.open-miner.com Microsoft SQL Server RapidMiner DB2 Intelligent Miner 2008  www.facebook.com/openmin er  Open Miner Intelligence : http://www.open-miner.com KNIME (Konstanz Information Miner) AN INTRODUCTION TO DATA MINING WITH WEKA
18. 18. Data Mining Software (2) 18  Weka OPEN MINER www.open-miner.com www.facebook.com/openmin er Open Miner Intelligence : http://www.open-miner.com AN INTRODUCTION TO DATA MINING WITH WEKA
19. 19. AN INTRODUCTION TO DATA MINING WITH WEKA BY OPEN MINER WWW.OPEN-MINER.COM Part III Introduction to Weka
20. 20. What is Weka ? 20  Weka  Waikato Environment for Knowledge Analysis  open source Data Mining  !!!  Java  Windows  Linux  MAC OS  Weka  http://www.cs.waikato.ac.nz/ml/weka/ OPEN MINER www.open-miner.com www.facebook.com/openmin er Open Miner Intelligence : http://www.open-miner.com AN INTRODUCTION TO DATA MINING WITH WEKA
21. 21. Download Weka 21  http://www.cs.waikato.ac.nz/ml/weka/ OPEN MINER www.open-miner.com www.facebook.com/openmin Java er Open Miner Intelligence : http://www.open-miner.com Java Java AN INTRODUCTION TO DATA MINING WITH WEKA !!
22. 22. Weka Explorer 22 Tab data mining OPEN MINER Workspace: Weka www.open-miner.com Explorer www.facebook.com/openmin er Status: Weka Open Miner Intelligence : http://www.open-miner.com Log: AN INTRODUCTION TO DATA MINING WITH WEKA
23. 23. AN INTRODUCTION TO DATA MINING WITH WEKA BY OPEN MINER WWW.OPEN-MINER.COM Part IV Preprocess
24. 24. Agenda 24  (instance) (attribute)   Weka      OPEN MINER www.open-miner.com CSV ARFF Preprocess Data Weka www.facebook.com/openmin er Outlier    Open Miner Intelligence : http://www.open-miner.com AN INTRODUCTION TO DATA MINING WITH WEKA
25. 25. Load data into Weka (2) 25  input Weka OPEN MINER (Databas (Internet (Generat File) e) www.open-miner.com ) e Data) CSV www.facebook.com/openmin ARF er F Open Miner Intelligence : http://www.open-miner.com AN INTRODUCTION TO DATA MINING WITH WEKA
26. 26. Lab 4-1: Generate CSV file 26 :  Weka CSV Excel 1: OPEN MINER www.open-miner.com  www.facebook.com/openmin Note : In sex attribute, value 0 = Female, 1 = Male, 2 = Others er customers.csv Open Miner Intelligence : http://www.open-miner.com AN INTRODUCTION TO DATA MINING WITH WEKA
27. 27. Weka & MySQL (4) 27  jdbc:mysql://localhost:3306/weka_cour se  URL : URL database server Click User OPEN MINER www.open-miner.com Server URL & port Database name www.facebook.com/openmin er Open Miner Intelligence : http://www.open-miner.com AN INTRODUCTION TO DATA MINING WITH WEKA
28. 28. 28 Replace missing values in Weka Choose   filters unsupervised attribute ReplaceMissingValues OPEN MINER www.open-miner.com    Apply www.facebook.com/openmin er  Open Miner Intelligence : http://www.open-miner.com AN INTRODUCTION TO DATA MINING WITH WEKA
29. 29. AN INTRODUCTION TO DATA MINING WITH WEKA BY OPEN MINER WWW.OPEN-MINER.COM Part V Regression & Classification
30. 30. Agenda 30 (Regression) (Data classification)      training, testing OPEN MINER www.open-miner.com www.facebook.com/openmin er      Linear Regression Decision tree K-nearest neighbors Neural Network Support Vector Machines (SVM) Open Miner Intelligence : http://www.open-miner.com AN INTRODUCTION TO DATA MINING WITH WEKA
31. 31. What is classification? 31 OPEN MINER www.open-miner.com www.facebook.com/openmin : er ? Open Miner Intelligence : http://www.open-miner.com AN INTRODUCTION TO DATA MINING WITH WEKA
32. 32. Example: Classification (3) 32  Model   training data class OPEN MINER tree model www.open-miner.com  Decision ≥ 100 < 100 www.facebook.com/openmin Tree er  Evaluate Model Open Miner Intelligence : http://www.open-miner.com AN INTRODUCTION TO DATA MINING WITH WEKA
33. 33. Example: Classification (4) 33  Unseen data (class)  OPEN MINER 134.86 96.01 158.83 www.open-miner.com www.facebook.com/openmin er ? Open Miner Intelligence : http://www.open-miner.com ? AN INTRODUCTION TO DATA MINING WITH WEKA
34. 34. Classification Steps (3) 34 34  (classification model building) 1 1 0  (Training data) OPEN MINER www.open-miner.com 2 0 A 1 B (Evaluate data) www.facebook.com/openmin er (evaluation) 1 1 3 2 A A 0 Unseen data 1 2 Open Miner Intelligence : http://www.open-miner.com 1 0 A AN INTRODUCTION TO DATA MINING WITH WEKA
35. 35. Classification in Weka (cont’) 35 tab Classify    OPEN MINER www.open-miner.com  www.facebook.com/openmin  er Open Miner Intelligence : http://www.open-miner.com AN INTRODUCTION TO DATA MINING WITH WEKA
36. 36. 1: Classifier 36 classification   Bayes OPEN MINER(probability) www.open-miner.com Functions   www.facebook.com/openmin er Lazy     Open Miner Intelligence : http://www.open-miner.com  classification AN INTRODUCTION TO DATA MINING WITH WEKA
37. 37. Lab 5-2: German Credit Card 37  Business Understanding    OPEN MINER system) (decision support www.open-miner.com Data Understanding www.facebook.com/openmin 600 er    GermanCreditBalance.arff Open Miner Intelligence CD : http://www.open-miner.com AN INTRODUCTION TO DATA MINING WITH WEKA
38. 38. AN INTRODUCTION TO DATA MINING WITH WEKA BY OPEN MINER WWW.OPEN-MINER.COM Part VI Clustering
39. 39. Segmentation 39          OPEN MINER (geographic) www.open-miner.com (demographic)  www.facebook.com/openmin er (behavior)          Open Miner Intelligence : http://www.open-miner.com AN INTRODUCTION TO DATA MINING WITH WEKA
40. 40. Data clustering 40 (clustering)      OPEN MINER www.open-miner.com (cluster) www.facebook.com/openmin (unsupervised learning) er Open Miner Intelligence : http://www.open-miner.com AN INTRODUCTION TO DATA MINING WITH WEKA
41. 41. Clustering in Weka (cont’) 41 tab Cluster    OPEN MINER www.open-miner.com www.facebook.com/openmin  er Open Miner Intelligence : http://www.open-miner.com AN INTRODUCTION TO DATA MINING WITH WEKA
42. 42. 42 Example1 : Clustering bank data (bank)  id ag e sex region inco marri childr save_a current_ mortga pe car me ed en ct act ge p ID121 INNER_CI FEMALE NO 01 TY ID121 MALE TOWN YES 02 ID121 INNER_CI FEMALE YES 03 TY ID121 FEMALE TOWN YES 04 ID121 FEMALE RURAL YES 05 ID121 FEMALE TOWN YES 06 ID121 MALE RURAL NO 07 ID121 MALE TOWN YES 08 ID121 SUBURBA FEMALE YES 09 N Open Miner Intelligence : http://www.open-miner.com ID121 MALE TOWN YES NO NO NO NO OPEN MINER www.open-miner.com YE S YE S YES NO YES YES NO YES YES NO NO NO NO YES NO NO NO YES NO NO NO NO YES YES NO YES NO NO YES NO YES www.facebook.com/openmin er YE YES YES NO NO S YE NO NO NO NO S YEAN INTRODUCTION TO DATA MINING WITH WEKA YES YES NO NO
43. 43. AN INTRODUCTION TO DATA MINING WITH WEKA BY OPEN MINER WWW.OPEN-MINER.COM Part VII Association Rules
44. 44. Market Basket Analysis 44 supermarket     OPEN MINER www.open-miner.com ? www.facebook.com/openmin er Open Miner Intelligence : http://www.open-miner.com AN INTRODUCTION TO DATA MINING WITH WEKA
45. 45. Data from point-of-sale (4) 45 POS database Transaction- time Product 01-13-2009 20:04 Apple 01-13-2009 20:04 Beer TID Product OPEN MINER www.open-miner.com 01-13-2009 20:04 Cereal Diapers 1 Apple, Beer, Cereal, Diapers 2 01-13-2009 20:04 Apple, Beer, Diapers, Eggs 3 Beer, Eggs Transaction database www.facebook.com/openmin Beer 01-14-2009 11:30 Diapers er 01-14-2009 11:30 Apple 01-14-2009 11:30 01-14-2009 11:30 Eggs 01-15-2009 14:15 Beer 01-15-2009 14:15 Eggs Open Miner Intelligence : http://www.open-miner.com AN INTRODUCTION TO DATA MINING WITH WEKA
46. 46. 46 Association Rules in Weka (cont’) tab Associate   OPEN MINER www.open-miner.com   www.facebook.com/openmin er Open Miner Intelligence : http://www.open-miner.com AN INTRODUCTION TO DATA MINING WITH WEKA
47. 47. Lab 7-1: Market Basket 47  Business Understanding CRM   OPEN MINER Data Understanding www.open-miner.com 1,000  www.facebook.com/openmin 2 …… er    ……  AN INTRODUCTION TO DATA supermarket_basket_transactions_2005.arff MINING WITH WEKA Open Miner Intelligence : http://www.open-miner.com
48. 48. AN INTRODUCTION TO DATA MINING WITH WEKA BY OPEN MINER WWW.OPEN-MINER.COM Part VIII Command line & Integrate System
49. 49. Weka in command line 49   Run > Weka cmd DOS DOS ( )   OPEN MINER www.open-miner.com www.facebook.com/openmin er  Open Miner Intelligence : http://www.open-miner.com AN INTRODUCTION TO DATA MINING WITH WEKA
50. 50. 50 Lab8-2: Weka in Java Program (2) Weka Explorer    OPEN MINER compile www.open-miner.com javac -classpath “C:Program FilesWeka- -6weka.jar” testClassifier.java run java -classpath “C:Program FilesWeka- -6weka.jar;.” testClassifier www.facebook.com/openmin er Open Miner Intelligence : http://www.open-miner.com AN INTRODUCTION TO DATA MINING WITH WEKA
51. 51. AN INTRODUCTION TO DATA MINING WITH WEKA BY OPEN MINER WWW.OPEN-MINER.COM Part IX Knowledge Flow
52. 52. Weka KnowledgeFlow 52  component workflow Weka OPEN MINER www.open-miner.com www.facebook.com/openmin er Open Miner Intelligence : http://www.open-miner.com AN INTRODUCTION TO DATA MINING WITH WEKA
53. 53. Example: Knowledge flow (7) 53   component TextViewer Layout ClassifierPerformanceEvaluator TextViewer Visualization text OPEN MINER www.open-miner.com www.facebook.com/openmin er Open Miner Intelligence : http://www.open-miner.com AN INTRODUCTION TO DATA MINING WITH WEKA
54. 54. Contact Us 54   E-mail  siriwont@gmail.com  Website  http://www.open-miner.com  Google Buzz  http://www.google.com/profiles/openminer Open Miner Intelligence : http://www.open-miner.com AN INTRODUCTION TO DATA MINING WITH WEKA