SlideShare una empresa de Scribd logo
1 de 17
Descargar para leer sin conexión
WEKA
IT For Business Intelligence

Ishan Awadhesh
10BM60033 • Term Paper • 19 April 2012




Vinod Gupta School of Management, IIT Kharagpur
   1
Table of Contents

WEKA!                                              3

Data Used!                                         5

Classification Analysis!                           6

Cluster Analysis!                                  11

Other Applications of Weka!                        17

References!                                        17




Vinod Gupta School of Management, IIT Kharagpur
   2
WEKA
Waikato Environment for Knowledge Analysis

DATA MINING TECHNIQUES

WEKA is a collection of state-of-the-art machine learning algorithms and data preprocessing
tools written in Java, developed at the University of Waikato, New Zealand. It is free software
that runs on almost any platform and is available under the GNU General Public License. It
has a wide range of applications in various data mining techniques. It provides extensive
support for the entire process of experimental data mining, including preparing the input
data, evaluating learning schemes statistically, and visualizing the input data and the result of
learning. The WEKA workbench includes methods for the main data mining problems:
regression, classification, clustering, association rule mining, and attribute selection. It can
be used in either of the following two interfaces –
•!    Command Line Interface (CLI)
•!    Graphical User Interface (GUI)



The WEKA GUI Chooser appears like this –




Vinod Gupta School of Management, IIT Kharagpur
                                                    3
The buttons can be used to start the following applications –
        •Explorer – Environment for exploring data with WEKA. It gives access to all the
        facilities using menu selection and form filling.
        •Experimenter – It can be used to get the answer for a question: Which methods and
        parameter values work best for the given problem?
        •KnowledgeFlow – Same function as explorer. Supports incremental learning. It
        allows designing configurations for streamed data processing. Incremental algorithms
        can be used to process very large datasets.
        •Simple CLI – It provides a simple Command Line Interface for directly executing
        WEKA commands.


This term paper will demonstrate the following two data mining techniques using WEKA:
•Classification
•Clustering (Simple K Means)




Vinod Gupta School of Management, IIT Kharagpur
                                           4
Data Used
The data used in this paper is Bank Data available in Comma Separated Values format




The data contains following fields
id - a unique identification number
age - age of customer in years (numeric)
sex - MALE / FEMALE
region - inner_city/rural/suburban/town
income- income of customer (numeric)
married - is the customer married (YES/NO)
children - number of children (numeric)
car - does the customer own a car (YES/NO)
save_acct - does the customer have a saving account (YES/NO)
current_acct - does the customer have a current account (YES/NO)
mortgage - does the customer have a mortgage (YES/NO)
pep - did customer buy a PEP (Personal Equity Plan) after the last mailing (YES/NO)




Vinod Gupta School of Management, IIT Kharagpur
                                      5
Classification Analysis

Question

"How likely is person X to buy the new Personal Equity?" By creating a classification tree (a
decision tree), the data can be mined to determine the likelihood of this person to buy a new
PEP. Possible nodes on the tree would be children, income level, marital status. The
attributes of this person can be used against the decision tree to determine the likelihood of
him purchasing the Personal Equity Plan.

Load the data file Bank_Data.CSV into WEKA. This file contains 900 records of present
customers of Bank.
We need to divide up our records so some data instances are used to create the model, and
some are used to test the model to ensure that we didn't overfit it.
Your screen should look like Figure 1 after loading the data.


Figure 1.Bank Data Classification in Weka




We select the Classify tab, then we select the trees node, then the J48 leaf




Vinod Gupta School of Management, IIT Kharagpur
                                                 6
Figure 2.Bank Data Classification Algorithm




At this point, we are ready to create our model in WEKA. Ensure that Use training set is
selected so we use the data set we just loaded to create our model. Click Start and let WEKA
run. The output from this model should look like the results in Listing 1.




Vinod Gupta School of Management, IIT Kharagpur
                                               7
Listing 1.Output from WEKA’s classification model




What do these numbers mean-
Correctly Classified Instances - 92.3333%
Incorrectly Classified Instances- 7.6667%
False Positives- 29
False Negatives-17
Based on our accuracy rate of 92.3333%, we can say that this is a pretty good model to predict
whether a new customer will buy Personal Equity Plan or not.



Vinod Gupta School of Management, IIT Kharagpur
                                             8
You can see the tree by right-clicking on the model you just created, in the result list. On the
pop-up menu, select Visualize tree. You'll see the classification tree we just created,
although in this example, the visual tree doesn't offer much help.


Figure 3. Classification Tree Visualization




There's one final step to validating our classification tree, which is to run our test set through
the model and ensure that accuracy of the model when evaluating the test set isn't too
different from the training set. To do this, in Test options, select the Supplied test set radio
button and click Set. Choose the file bmw-test.arff, which contains 1,500 records that were
not in the training set we used to create the model. When we click Start this time, WEKA will
run this test data set through the model we already created and let us know how the model did.
Let's do that, by clicking Start. Below is the output.




Vinod Gupta School of Management, IIT Kharagpur
                                                   9
Listing 2.Output from WEKA’s classification model of Test Data




Comparing the "Correctly Classified Instances" from this test set (90.5 percent) with the
"Correctly Classified Instances" from the training set (92.3333 percent), we see that the
accuracy of the model is pretty close, which indicates that the model will not break down with
unknown data, or when future data is applied to it.




Vinod Gupta School of Management, IIT Kharagpur
                                            10
Cluster Analysis

Question: "What age groups more likely to buy Personal Equity Plan?" The data can be
mined to compare the age of the purchaser of past PEP . From this data, it could be found
whether certain age groups (22-30 year olds, for example) have a higher propensity to to go
for PEP. The data, when mined, will tend to cluster around certain age groups and certain
colors, allowing the user to quickly determine patterns in the data.


Load the data file Bank_data.CSV into WEKA using the same steps we used to load data into
the Preprocess tab. Take a few minutes to look around the data in this tab. Look at the
columns, the attribute data, the distribution of the columns, etc. Your screen should look like
Figure 4 after loading the data.


Figure 4. Bank cluster data in Weka




With this data set, we are looking to create clusters, so instead of clicking on the Classify tab,
click on the Cluster tab. Click Choose and select SimpleKMeans from the choices that appear
(this will be our preferred method of clustering for this article).


Vinod Gupta School of Management, IIT Kharagpur
                                                11
Finally, we want to adjust the attributes of our cluster algorithm by clicking SimpleKMeans .
The only attribute of the algorithm we are interested in adjusting here is the numClusters
field, which tells us how many clusters we want to create. Let's change the default value of 2 to
5 for now, but keep these steps in mind later if you want to adjust the number of clusters
created. Your WEKA Explorer should look like Figure 5 at this point. Click OK to accept
these values.


Figure 5. Cluster Attributes




At this point, we are ready to run the clustering algorithm. Remember that 100 rows of data
with five data clusters would likely take a few hours of computation with a spreadsheet, but
WEKA can spit out the answer in less than a second. Your output should look like Listing 3.




Vinod Gupta School of Management, IIT Kharagpur
                                               12
Listing 3. Cluster Output with 5 clusters




Vinod Gupta School of Management, IIT Kharagpur
   13
Listing 4. Cluster Output with 10 Clusters




Clusters


One thing that is clear from the clusters is that behavior of Male are clustered in only 2-3
groups while females behavior are heavily distributed among 7 clusters, so preparing an
offering for a specific


Description of Clusters-


Cluster 0- This group consists of unmarried, mid-income earning females in their early 40’s
who live in rural areas. They have on an average two children, no car and personal equity plan
but they do have savings and current account.


Cluster 1- This group consists of married, high-income earning females in their late 40’s who
live in rural areas. They have on an average two children,no car and personal equity plan but
they do have savings and current account.


Cluster 2- This group consists of married, low-income earning females in their early 40’s who
live in inner city. They have on an average one child, no car and savings account but they do
have current account and personal equity plan.



Vinod Gupta School of Management, IIT Kharagpur
                                                14
Cluster 3- This group consists of married, low-income earning females in their early 30’s who
live in town. They have on an average one or two children, no car, savings account and
personal equity plan but they do have current account.


Cluster 4- This group consists of married, mid-income earning males in their late 30’s who
live in inner city. They have on an average one or no child, no savings account but they do
have personal equity plan, savings & current account.


Cluster 5- This group consists of unmarried, high-income earning males in their early 40’s
who live in town. They have on an average one or no child, they have car, personal equity plan,
savings & current account.


Cluster 6- This group consists of married, mid-income earning females in their early 40’s
who live in inner city. They mostly don’t have ant child, they do not have any savings account
and personal equity plan but they do have current account.


Cluster 7- This group consists of unmarried, high-income earning females in their mid 40’s
who live in inner city. They have on an average one or two child, no car and personal equity
plan but they do have savings & current account.


Cluster 8- This group consists of unmarried, high-income earning females in their mid 40’s
who live in town. They have on an average one or no child, no personal equity plan but they do
have car, savings & current account.


Cluster 9- This group consists of married, mid-income earning males in their early 40’s who
live in inner city. They have on an average one or two children, no car, personal equity   plan
and current account but they do have savings account.




Vinod Gupta School of Management, IIT Kharagpur
                                               15
One other interesting way to examine the data in these clusters is to inspect it visually. To do
this, you should right-click on theResult List section of the Cluster tab . One of the options
from this pop-up menu is Visualize Cluster Assignments. A window will pop up that lets you
play with the results and see them visually. For this example, change the X axis to be income
(Num), the Y axis to children (Num), and the Color to Cluster (Nom). This will show us in a
chart how the clusters are grouped in terms of income and no’ of children. Also, turn up the
"Jitter" to about three-fourths of the way maxed out, which will artificially scatter the plot
points to allow us to see them more easily.


Figure 6. Cluster Visual Inspection




Vinod Gupta School of Management, IIT Kharagpur
                                                 16
Other Applications of Weka

•DISCRETIZATION

•REGRESSION

•NEAREST NEIGHBOR




References
https://www.ibm.com/developerworks/opensource/library/os-weka2/
http://maya.cs.depaul.edu/classes/ect584/weka/preprocess.html
http://www.cs.waikato.ac.nz/~ml/weka/




Vinod Gupta School of Management, IIT Kharagpur
                  17

Más contenido relacionado

La actualidad más candente

9 big o-notation
9 big o-notation9 big o-notation
9 big o-notation
irdginfo
 
Stacks & Queues
Stacks & QueuesStacks & Queues
Stacks & Queues
tech4us
 

La actualidad más candente (20)

Canonical correlation
Canonical correlationCanonical correlation
Canonical correlation
 
weka data mining
weka data mining weka data mining
weka data mining
 
Avl tree
Avl treeAvl tree
Avl tree
 
K-MEDOIDS CLUSTERING USING PARTITIONING AROUND MEDOIDS FOR PERFORMING FACE R...
K-MEDOIDS CLUSTERING  USING PARTITIONING AROUND MEDOIDS FOR PERFORMING FACE R...K-MEDOIDS CLUSTERING  USING PARTITIONING AROUND MEDOIDS FOR PERFORMING FACE R...
K-MEDOIDS CLUSTERING USING PARTITIONING AROUND MEDOIDS FOR PERFORMING FACE R...
 
2.5 backpropagation
2.5 backpropagation2.5 backpropagation
2.5 backpropagation
 
3.3 shell sort
3.3 shell sort3.3 shell sort
3.3 shell sort
 
Yolov5
Yolov5 Yolov5
Yolov5
 
K-Nearest Neighbor Classifier
K-Nearest Neighbor ClassifierK-Nearest Neighbor Classifier
K-Nearest Neighbor Classifier
 
K means clustering
K means clusteringK means clustering
K means clustering
 
9 big o-notation
9 big o-notation9 big o-notation
9 big o-notation
 
Stacks & Queues
Stacks & QueuesStacks & Queues
Stacks & Queues
 
The Kernel Trick
The Kernel TrickThe Kernel Trick
The Kernel Trick
 
MySQL Views
MySQL ViewsMySQL Views
MySQL Views
 
Implement principal component analysis (PCA) in python from scratch
Implement principal component analysis (PCA) in python from scratchImplement principal component analysis (PCA) in python from scratch
Implement principal component analysis (PCA) in python from scratch
 
[2023] Cut and Learn for Unsupervised Object Detection and Instance Segmentation
[2023] Cut and Learn for Unsupervised Object Detection and Instance Segmentation[2023] Cut and Learn for Unsupervised Object Detection and Instance Segmentation
[2023] Cut and Learn for Unsupervised Object Detection and Instance Segmentation
 
Hash table
Hash tableHash table
Hash table
 
Tabnet presentation
Tabnet presentationTabnet presentation
Tabnet presentation
 
Machine Learning
Machine Learning Machine Learning
Machine Learning
 
SQL select clause
SQL select clauseSQL select clause
SQL select clause
 
Generative Adversarial Networks
Generative Adversarial NetworksGenerative Adversarial Networks
Generative Adversarial Networks
 

Similar a Classification and Clustering Analysis using Weka

Weka_Manual_Sagar
Weka_Manual_SagarWeka_Manual_Sagar
Weka_Manual_Sagar
Sagar Kumar
 

Similar a Classification and Clustering Analysis using Weka (20)

Data Mining Techniques using WEKA (Ankit Pandey-10BM60012)
Data Mining Techniques using WEKA (Ankit Pandey-10BM60012)Data Mining Techniques using WEKA (Ankit Pandey-10BM60012)
Data Mining Techniques using WEKA (Ankit Pandey-10BM60012)
 
Weka_Manual_Sagar
Weka_Manual_SagarWeka_Manual_Sagar
Weka_Manual_Sagar
 
Barga Data Science lecture 10
Barga Data Science lecture 10Barga Data Science lecture 10
Barga Data Science lecture 10
 
Data Mining using Weka
Data Mining using WekaData Mining using Weka
Data Mining using Weka
 
Feature extraction for classifying students based on theirac ademic performance
Feature extraction for classifying students based on theirac ademic performanceFeature extraction for classifying students based on theirac ademic performance
Feature extraction for classifying students based on theirac ademic performance
 
Post Graduate Admission Prediction System
Post Graduate Admission Prediction SystemPost Graduate Admission Prediction System
Post Graduate Admission Prediction System
 
AI TESTING: ENSURING A GOOD DATA SPLIT BETWEEN DATA SETS (TRAINING AND TEST) ...
AI TESTING: ENSURING A GOOD DATA SPLIT BETWEEN DATA SETS (TRAINING AND TEST) ...AI TESTING: ENSURING A GOOD DATA SPLIT BETWEEN DATA SETS (TRAINING AND TEST) ...
AI TESTING: ENSURING A GOOD DATA SPLIT BETWEEN DATA SETS (TRAINING AND TEST) ...
 
Loan Analysis Predicting Defaulters
Loan Analysis Predicting DefaultersLoan Analysis Predicting Defaulters
Loan Analysis Predicting Defaulters
 
IRJET- Analysis of Brand Value Prediction based on Social Media Data
IRJET-  	  Analysis of Brand Value Prediction based on Social Media DataIRJET-  	  Analysis of Brand Value Prediction based on Social Media Data
IRJET- Analysis of Brand Value Prediction based on Social Media Data
 
Data Mining GUI Tools with Demo
Data Mining GUI Tools with DemoData Mining GUI Tools with Demo
Data Mining GUI Tools with Demo
 
data-science-lifecycle-ebook.pdf
data-science-lifecycle-ebook.pdfdata-science-lifecycle-ebook.pdf
data-science-lifecycle-ebook.pdf
 
A Comparative Study on Identical Face Classification using Machine Learning
A Comparative Study on Identical Face Classification using Machine LearningA Comparative Study on Identical Face Classification using Machine Learning
A Comparative Study on Identical Face Classification using Machine Learning
 
BIG MART SALES PREDICTION USING MACHINE LEARNING
BIG MART SALES PREDICTION USING MACHINE LEARNINGBIG MART SALES PREDICTION USING MACHINE LEARNING
BIG MART SALES PREDICTION USING MACHINE LEARNING
 
STOCK MARKET ANALYZING AND PREDICTION USING MACHINE LEARNING TECHNIQUES
STOCK MARKET ANALYZING AND PREDICTION USING MACHINE LEARNING TECHNIQUESSTOCK MARKET ANALYZING AND PREDICTION USING MACHINE LEARNING TECHNIQUES
STOCK MARKET ANALYZING AND PREDICTION USING MACHINE LEARNING TECHNIQUES
 
LOAN APPROVAL PRDICTION SYSTEM USING MACHINE LEARNING.
LOAN APPROVAL PRDICTION SYSTEM USING MACHINE LEARNING.LOAN APPROVAL PRDICTION SYSTEM USING MACHINE LEARNING.
LOAN APPROVAL PRDICTION SYSTEM USING MACHINE LEARNING.
 
Introduction to Machine Learning and Data Science using the Autonomous databa...
Introduction to Machine Learning and Data Science using the Autonomous databa...Introduction to Machine Learning and Data Science using the Autonomous databa...
Introduction to Machine Learning and Data Science using the Autonomous databa...
 
The 8 Step Data Mining Process
The 8 Step Data Mining ProcessThe 8 Step Data Mining Process
The 8 Step Data Mining Process
 
Machine Learning in Autonomous Data Warehouse
 Machine Learning in Autonomous Data Warehouse Machine Learning in Autonomous Data Warehouse
Machine Learning in Autonomous Data Warehouse
 
IRJET- Sentimental Analysis of Product Reviews for E-Commerce Websites
IRJET- Sentimental Analysis of Product Reviews for E-Commerce WebsitesIRJET- Sentimental Analysis of Product Reviews for E-Commerce Websites
IRJET- Sentimental Analysis of Product Reviews for E-Commerce Websites
 
Introduction to Machine Learning and Data Science using Autonomous Database ...
Introduction to Machine Learning and Data Science using Autonomous Database  ...Introduction to Machine Learning and Data Science using Autonomous Database  ...
Introduction to Machine Learning and Data Science using Autonomous Database ...
 

Último

Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please Practise
AnaAcapella
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
QucHHunhnh
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
ZurliaSoop
 

Último (20)

Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please Practise
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptx
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
Spatium Project Simulation student brief
Spatium Project Simulation student briefSpatium Project Simulation student brief
Spatium Project Simulation student brief
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
 
Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...
 

Classification and Clustering Analysis using Weka

  • 1. WEKA IT For Business Intelligence Ishan Awadhesh 10BM60033 • Term Paper • 19 April 2012 Vinod Gupta School of Management, IIT Kharagpur 1
  • 2. Table of Contents WEKA! 3 Data Used! 5 Classification Analysis! 6 Cluster Analysis! 11 Other Applications of Weka! 17 References! 17 Vinod Gupta School of Management, IIT Kharagpur 2
  • 3. WEKA Waikato Environment for Knowledge Analysis DATA MINING TECHNIQUES WEKA is a collection of state-of-the-art machine learning algorithms and data preprocessing tools written in Java, developed at the University of Waikato, New Zealand. It is free software that runs on almost any platform and is available under the GNU General Public License. It has a wide range of applications in various data mining techniques. It provides extensive support for the entire process of experimental data mining, including preparing the input data, evaluating learning schemes statistically, and visualizing the input data and the result of learning. The WEKA workbench includes methods for the main data mining problems: regression, classification, clustering, association rule mining, and attribute selection. It can be used in either of the following two interfaces – •! Command Line Interface (CLI) •! Graphical User Interface (GUI) The WEKA GUI Chooser appears like this – Vinod Gupta School of Management, IIT Kharagpur 3
  • 4. The buttons can be used to start the following applications – •Explorer – Environment for exploring data with WEKA. It gives access to all the facilities using menu selection and form filling. •Experimenter – It can be used to get the answer for a question: Which methods and parameter values work best for the given problem? •KnowledgeFlow – Same function as explorer. Supports incremental learning. It allows designing configurations for streamed data processing. Incremental algorithms can be used to process very large datasets. •Simple CLI – It provides a simple Command Line Interface for directly executing WEKA commands. This term paper will demonstrate the following two data mining techniques using WEKA: •Classification •Clustering (Simple K Means) Vinod Gupta School of Management, IIT Kharagpur 4
  • 5. Data Used The data used in this paper is Bank Data available in Comma Separated Values format The data contains following fields id - a unique identification number age - age of customer in years (numeric) sex - MALE / FEMALE region - inner_city/rural/suburban/town income- income of customer (numeric) married - is the customer married (YES/NO) children - number of children (numeric) car - does the customer own a car (YES/NO) save_acct - does the customer have a saving account (YES/NO) current_acct - does the customer have a current account (YES/NO) mortgage - does the customer have a mortgage (YES/NO) pep - did customer buy a PEP (Personal Equity Plan) after the last mailing (YES/NO) Vinod Gupta School of Management, IIT Kharagpur 5
  • 6. Classification Analysis Question "How likely is person X to buy the new Personal Equity?" By creating a classification tree (a decision tree), the data can be mined to determine the likelihood of this person to buy a new PEP. Possible nodes on the tree would be children, income level, marital status. The attributes of this person can be used against the decision tree to determine the likelihood of him purchasing the Personal Equity Plan. Load the data file Bank_Data.CSV into WEKA. This file contains 900 records of present customers of Bank. We need to divide up our records so some data instances are used to create the model, and some are used to test the model to ensure that we didn't overfit it. Your screen should look like Figure 1 after loading the data. Figure 1.Bank Data Classification in Weka We select the Classify tab, then we select the trees node, then the J48 leaf Vinod Gupta School of Management, IIT Kharagpur 6
  • 7. Figure 2.Bank Data Classification Algorithm At this point, we are ready to create our model in WEKA. Ensure that Use training set is selected so we use the data set we just loaded to create our model. Click Start and let WEKA run. The output from this model should look like the results in Listing 1. Vinod Gupta School of Management, IIT Kharagpur 7
  • 8. Listing 1.Output from WEKA’s classification model What do these numbers mean- Correctly Classified Instances - 92.3333% Incorrectly Classified Instances- 7.6667% False Positives- 29 False Negatives-17 Based on our accuracy rate of 92.3333%, we can say that this is a pretty good model to predict whether a new customer will buy Personal Equity Plan or not. Vinod Gupta School of Management, IIT Kharagpur 8
  • 9. You can see the tree by right-clicking on the model you just created, in the result list. On the pop-up menu, select Visualize tree. You'll see the classification tree we just created, although in this example, the visual tree doesn't offer much help. Figure 3. Classification Tree Visualization There's one final step to validating our classification tree, which is to run our test set through the model and ensure that accuracy of the model when evaluating the test set isn't too different from the training set. To do this, in Test options, select the Supplied test set radio button and click Set. Choose the file bmw-test.arff, which contains 1,500 records that were not in the training set we used to create the model. When we click Start this time, WEKA will run this test data set through the model we already created and let us know how the model did. Let's do that, by clicking Start. Below is the output. Vinod Gupta School of Management, IIT Kharagpur 9
  • 10. Listing 2.Output from WEKA’s classification model of Test Data Comparing the "Correctly Classified Instances" from this test set (90.5 percent) with the "Correctly Classified Instances" from the training set (92.3333 percent), we see that the accuracy of the model is pretty close, which indicates that the model will not break down with unknown data, or when future data is applied to it. Vinod Gupta School of Management, IIT Kharagpur 10
  • 11. Cluster Analysis Question: "What age groups more likely to buy Personal Equity Plan?" The data can be mined to compare the age of the purchaser of past PEP . From this data, it could be found whether certain age groups (22-30 year olds, for example) have a higher propensity to to go for PEP. The data, when mined, will tend to cluster around certain age groups and certain colors, allowing the user to quickly determine patterns in the data. Load the data file Bank_data.CSV into WEKA using the same steps we used to load data into the Preprocess tab. Take a few minutes to look around the data in this tab. Look at the columns, the attribute data, the distribution of the columns, etc. Your screen should look like Figure 4 after loading the data. Figure 4. Bank cluster data in Weka With this data set, we are looking to create clusters, so instead of clicking on the Classify tab, click on the Cluster tab. Click Choose and select SimpleKMeans from the choices that appear (this will be our preferred method of clustering for this article). Vinod Gupta School of Management, IIT Kharagpur 11
  • 12. Finally, we want to adjust the attributes of our cluster algorithm by clicking SimpleKMeans . The only attribute of the algorithm we are interested in adjusting here is the numClusters field, which tells us how many clusters we want to create. Let's change the default value of 2 to 5 for now, but keep these steps in mind later if you want to adjust the number of clusters created. Your WEKA Explorer should look like Figure 5 at this point. Click OK to accept these values. Figure 5. Cluster Attributes At this point, we are ready to run the clustering algorithm. Remember that 100 rows of data with five data clusters would likely take a few hours of computation with a spreadsheet, but WEKA can spit out the answer in less than a second. Your output should look like Listing 3. Vinod Gupta School of Management, IIT Kharagpur 12
  • 13. Listing 3. Cluster Output with 5 clusters Vinod Gupta School of Management, IIT Kharagpur 13
  • 14. Listing 4. Cluster Output with 10 Clusters Clusters One thing that is clear from the clusters is that behavior of Male are clustered in only 2-3 groups while females behavior are heavily distributed among 7 clusters, so preparing an offering for a specific Description of Clusters- Cluster 0- This group consists of unmarried, mid-income earning females in their early 40’s who live in rural areas. They have on an average two children, no car and personal equity plan but they do have savings and current account. Cluster 1- This group consists of married, high-income earning females in their late 40’s who live in rural areas. They have on an average two children,no car and personal equity plan but they do have savings and current account. Cluster 2- This group consists of married, low-income earning females in their early 40’s who live in inner city. They have on an average one child, no car and savings account but they do have current account and personal equity plan. Vinod Gupta School of Management, IIT Kharagpur 14
  • 15. Cluster 3- This group consists of married, low-income earning females in their early 30’s who live in town. They have on an average one or two children, no car, savings account and personal equity plan but they do have current account. Cluster 4- This group consists of married, mid-income earning males in their late 30’s who live in inner city. They have on an average one or no child, no savings account but they do have personal equity plan, savings & current account. Cluster 5- This group consists of unmarried, high-income earning males in their early 40’s who live in town. They have on an average one or no child, they have car, personal equity plan, savings & current account. Cluster 6- This group consists of married, mid-income earning females in their early 40’s who live in inner city. They mostly don’t have ant child, they do not have any savings account and personal equity plan but they do have current account. Cluster 7- This group consists of unmarried, high-income earning females in their mid 40’s who live in inner city. They have on an average one or two child, no car and personal equity plan but they do have savings & current account. Cluster 8- This group consists of unmarried, high-income earning females in their mid 40’s who live in town. They have on an average one or no child, no personal equity plan but they do have car, savings & current account. Cluster 9- This group consists of married, mid-income earning males in their early 40’s who live in inner city. They have on an average one or two children, no car, personal equity plan and current account but they do have savings account. Vinod Gupta School of Management, IIT Kharagpur 15
  • 16. One other interesting way to examine the data in these clusters is to inspect it visually. To do this, you should right-click on theResult List section of the Cluster tab . One of the options from this pop-up menu is Visualize Cluster Assignments. A window will pop up that lets you play with the results and see them visually. For this example, change the X axis to be income (Num), the Y axis to children (Num), and the Color to Cluster (Nom). This will show us in a chart how the clusters are grouped in terms of income and no’ of children. Also, turn up the "Jitter" to about three-fourths of the way maxed out, which will artificially scatter the plot points to allow us to see them more easily. Figure 6. Cluster Visual Inspection Vinod Gupta School of Management, IIT Kharagpur 16
  • 17. Other Applications of Weka •DISCRETIZATION •REGRESSION •NEAREST NEIGHBOR References https://www.ibm.com/developerworks/opensource/library/os-weka2/ http://maya.cs.depaul.edu/classes/ect584/weka/preprocess.html http://www.cs.waikato.ac.nz/~ml/weka/ Vinod Gupta School of Management, IIT Kharagpur 17