WEKA Tutorial #1.2 - How to Build a Data Mining Model from Scratch

Data Professor · Beginner ·🛠️ AI Tools & Apps ·6y ago

Key Takeaways

The video demonstrates how to build a data mining model from scratch using the WEKA data mining software, specifically using the Iris flower dataset and a decision tree classifier with 10-fold cross-validation. The model achieves 96% accuracy and correctly classifies 144 out of 150 flowers.

Full Transcript

so let's see to where it is installed okay so it's right here we got 383 so I'll click on the weeka 3.8 okay so I just click on ok here just a warning information telling that we can use many learning schemes and tools and there's a tools menu ok ok and so let's get started and building our model so why don't you click on the Explorer button so in in this weaker Explorer it allows you to intuitively build your prediction model by clicking on specific functions so let's get started by importing the data set and the data set that we're going to use in this practical tutorial will be the famous iris data set iris data set is a public domain data set that is commonly used as an example data set for teaching data mining and let's find it so click on the Open File go to the C Drive go to the Program Files I'm not sure whether it is Program Files here or program files with x86 so let me try the first one so there should be a folder called Rika ok so it's in the Program Files we got 3/8 go to data subfolder and then find iris ok here we go iris dot AR FF now they also have the iris to D so let's go with iris dot AR FF click on open and then this is what we see so let's just have a look at what this the various feature or menus are doing so in this panel here it tells you about the attributes or the variables that this data set has and so we can see that there are a total of five variables the first one being the super lane the super width the pedal length the pit of wit and in a class so this data said it's a data set of 150 flowers that are closely related caught iris and they are described by four variables the length and the width of the sepal the length and the width of the petal and then it is for each flower it is given a corresponding label as being either a C Tosa a versi color or a virginica and so here we can see again that okay this is the iris dataset it has a total of a hundred and fifty flowers and there are five attributes or five variables that we see here and if you click this if you click on it and to the right you will see some description about it so you can see that there are 50 iris setosa 50 iris versicolor 50 iris virginica and there are no missing data here that's good to know so click on the first variable we can see that the minimum value is 4.3 the maximum value is 7.9 the mean value 5.8 for 3 with a standard deviation of 0.8 to 8 and then we get the same information by clicking on the subsequent variables so we see the minimum maximum the mean the standard deviation okay so notice that the numbers here mean and standard deviation it really depends on the average value of each variable and then the standard deviation which is tell us the variability of each variable so before we build a prediction model let's first start by normalizing our data because each variable will have different minimum and mm as you can see the first one has 4.3 a minimum of 4.3 maximum of 7.9 second variable has minimum of 2 maximum 4.4 has the third one has to pedal length of 1 maximum of 6.9 the fourth variable has a minimum of 0.1 maximum of 2.5 and we notice that the mean and standard deviation of each of one of them are different so let's get started by first normal icing or standardizing our variable so let me begin by slicing the minimum and maximum to be 0 and 1 so we can do that very easily in arica so we have to click on the arrow on supervised attributes then click on normalize and then apply so before I click on the button notice that the minimum maximum or zero point one two point five one and six point nine two and 4.4 4.3 and seven point nine so I'll click here apply and all this what change what changes so the minimum value becomes zero and one and we also notice that the me know and also standard deviation also differed and here same thing minimum maximums zero and one third variable same thing zero and one fourth variable zero and one or alternatively so I can undo that alternatively so that will bring us back to the original state so alternatively instead of normalized I could use standardized so it's in the same supporter filter unsupervised attribute and then I'll find the standardized so click on standardize click on apply but notice that the mean and the standard deviation will be altered so we see that they are 5.8 here 0.8 here 3 and 0.4 three point seven one point seven one point one nine nine seven point seven six three so click on apply okay and so the the mean becomes zero and the standard deviation becomes one so this will happen for every one of them dart variable also and also the fourth variable however okay so nothing happens to the class we got that that is the class where we are going to make our classification so in data mining there are many tasks that you can do you could visualize data you could cluster the data you could classify the data you could be at a regression model but for this example because our class or our output label is a qualitative label therefore we will perform classification by classification we mean that we will categorize each of the 150 flowers into one of the three class label here either as a C Tosa versicolor or virginica so this step is called data pre-processing where we normalize or standardize the variable so decide on one of the or the other either normalize or standardize but not both so the one or the other and when you are ready go to the next step which is to click on the classify tab so let's click on that and then go to the classifier so choose a classifier and let's go with a how about a decision tree so let's begin with aj 4.8 so this is essentially using the c 4.5 algorithm by Ross Quinlan so click on the tape 48 and then the default for doing the test would be cross-validation using a 10-fold so I'm going to cover this in a future video about how you can split your data set into training and testing and also how you can do the cross-validation set so in this tutorial I'm going to stick to the default and so we'll click on the start button and then your prediction model will be constructed so you have seen that it takes only a couple of seconds not even a second so maybe half a second to create your model so here this is the summary of your prediction model so let's start by scrolling up on top okay so this provides a description the algorithm that you're using your using T 48 you have a hundred and fifty sample size you have five variables you are using 10-fold cross-validation and this is the resulting decision tree created file inside your prediction model there are total 5 leaves the size of the tree is 9 and then these are the performance metric of your prediction model so you see that you have a 96% accuracy and correctly classifying 144 out of 150 flowers into one of the three classes correctly and that we have six that we have misclassified and we have kappa statistics here in absolute error with me squared error and others as well we also are provided with the true positive rate false positive rate position we call f-measure mcc or the matthews correlation coefficient or i will see the class so here we are given the performance metric for each of the three classes and then this is the average weight of all the three classes and the confusion matrix is provided below so what is the confusion matrix it allows you to see how your prediction model is confused so if you look under the hood you have 50 flowers for each of the iris setosa class 50 flowers for IRS versicolor and 50 flowers for RS virginica so out of 50 we have correctly classified 49 and we have misclassified one of them so a right here 8 is represented by iris setosa and so for the iris setosa out of 50 one of them is misclassified to BB b is iris versus versicolor so we can see that one flower that is supposed to be classified as iris setosa was misclassified as iris versicolor okay so going to the second line we see that 47 iris versicolor have been correctly classified and 3 iris versicolor have been misclassified to be iris virginica okay we'll be gone to the third row 48 Irish virginica have been correctly classified as iris virginica however two of the iris virginica have been misclassified to BB or iris versicolor so this is very useful in helping us to understand the confusion made by our prediction model so until next time I'm telling an x in a mod on the data professor channel and if you haven't subscribed yet please consider subscribing clicking on you know education bell so that you will be modified so I'll see you in [Music]

Original Description

In this Part 2 video (of a 3 part series), we will continue our journey in learning about how to build your first data mining model from scratch using the WEKA data mining software. Particularly, you will now perform data pre-processing and construct the prediction model using the Iris flower data set. This 3 part video series is made for the absolute beginner as we guide you step-by-step on building a data mining model from scratch. 🌟 Buy me a coffee: https://www.buymeacoffee.com/dataprofessor ⭕ Playlist: Check out our other videos in the following playlists. ✅ Data Science 101: https://bit.ly/dataprofessor-ds101 ✅ Data Science YouTuber Podcast: https://bit.ly/datascience-youtuber-podcast ✅ Data Science Virtual Internship: https://bit.ly/dataprofessor-internship ✅ Bioinformatics: http://bit.ly/dataprofessor-bioinformatics ✅ Data Science Toolbox: https://bit.ly/dataprofessor-datasciencetoolbox ✅ Streamlit (Web App in Python): https://bit.ly/dataprofessor-streamlit ✅ Shiny (Web App in R): https://bit.ly/dataprofessor-shiny ✅ Google Colab Tips and Tricks: https://bit.ly/dataprofessor-google-colab ✅ Pandas Tips and Tricks: https://bit.ly/dataprofessor-pandas ✅ Python Data Science Project: https://bit.ly/dataprofessor-python-ds ✅ R Data Science Project: https://bit.ly/dataprofessor-r-ds ⭕ Subscribe: If you're new here, it would mean the world to me if you would consider subscribing to this channel. ✅ Subscribe: https://www.youtube.com/dataprofessor?sub_confirmation=1 ⭕ Recommended Tools: Kite is a FREE AI-powered coding assistant that will help you code faster and smarter. The Kite plugin integrates with all the top editors and IDEs to give you smart completions and documentation while you’re typing. I've been using Kite and I love it! ✅ Check out Kite: https://www.kite.com/get-kite/?utm_medium=referral&utm_source=youtube&utm_campaign=dataprofessor&utm_content=description-only ⭕ Recommended Books: ✅ Hands-On Machine Learning with Scikit-Learn : https://amzn.to/3h
Watch on YouTube ↗ (saves to browser)
Sign in to unlock AI tutor explanation · ⚡30

Playlist

Uploads from Data Professor · Data Professor · 3 of 60

1 How a Biologist became a Data Scientist
How a Biologist became a Data Scientist
Data Professor
2 WEKA Tutorial #1.1 - How to Build a Data Mining Model from Scratch
WEKA Tutorial #1.1 - How to Build a Data Mining Model from Scratch
Data Professor
WEKA Tutorial #1.2 - How to Build a Data Mining Model from Scratch
WEKA Tutorial #1.2 - How to Build a Data Mining Model from Scratch
Data Professor
4 WEKA Tutorial #1.3 - How to Build a Data Mining Model from Scratch
WEKA Tutorial #1.3 - How to Build a Data Mining Model from Scratch
Data Professor
5 Computational Drug Discovery: Machine Learning for Making Sense of Big Data in Drug Discovery
Computational Drug Discovery: Machine Learning for Making Sense of Big Data in Drug Discovery
Data Professor
6 Quotes #1 on Big Data and Data Science
Quotes #1 on Big Data and Data Science
Data Professor
7 Quotes #2 on Big Data and Data Science
Quotes #2 on Big Data and Data Science
Data Professor
8 Quotes #3 on Big Data and Data Science
Quotes #3 on Big Data and Data Science
Data Professor
9 Quotes #4 on Big Data and Data Science
Quotes #4 on Big Data and Data Science
Data Professor
10 Quotes #5 on Big Data and Data Science
Quotes #5 on Big Data and Data Science
Data Professor
11 Data Science 101: Starting a Data Science / Data Mining Project
Data Science 101: Starting a Data Science / Data Mining Project
Data Professor
12 Data Science 101: CRISP-DM - Data Mining / Data Science in 6 Steps
Data Science 101: CRISP-DM - Data Mining / Data Science in 6 Steps
Data Professor
13 R Programming 101: How to Define Variables
R Programming 101: How to Define Variables
Data Professor
14 R Programming 101: Read and Write CSV files
R Programming 101: Read and Write CSV files
Data Professor
15 Data Science 101: Basic Command-Line for Data Science
Data Science 101: Basic Command-Line for Data Science
Data Professor
16 Strategies for Learning Data Science in 2020 (Data Science 101)
Strategies for Learning Data Science in 2020 (Data Science 101)
Data Professor
17 Building your Data Science Portfolio with GitHub (Data Science 101)
Building your Data Science Portfolio with GitHub (Data Science 101)
Data Professor
18 R Programming 101: Setting up R programming environment (R, RStudio and RStudio.cloud)
R Programming 101: Setting up R programming environment (R, RStudio and RStudio.cloud)
Data Professor
19 Exploratory Data Analysis in R: Towards Data Understanding
Exploratory Data Analysis in R: Towards Data Understanding
Data Professor
20 Exploratory Data Analysis in R: Quick Dive into Data Visualization
Exploratory Data Analysis in R: Quick Dive into Data Visualization
Data Professor
21 Machine Learning in R: Building a Classification Model
Machine Learning in R: Building a Classification Model
Data Professor
22 Machine Learning in R: Repurpose Machine Learning Code for New Data
Machine Learning in R: Repurpose Machine Learning Code for New Data
Data Professor
23 Data Science 101: Deploying your Machine Learning Model
Data Science 101: Deploying your Machine Learning Model
Data Professor
24 Machine Learning in R: Deploy Machine Learning Model using RDS
Machine Learning in R: Deploy Machine Learning Model using RDS
Data Professor
25 Data Pre-processing in R: Handling Missing Data
Data Pre-processing in R: Handling Missing Data
Data Professor
26 Machine Learning in R: Speed up Model Building with Parallel Computing
Machine Learning in R: Speed up Model Building with Parallel Computing
Data Professor
27 Data Science 101: Overview of Machine Learning Model Building Process
Data Science 101: Overview of Machine Learning Model Building Process
Data Professor
28 Web Apps in R: Building your First Web Application in R | Shiny Tutorial Ep 1
Web Apps in R: Building your First Web Application in R | Shiny Tutorial Ep 1
Data Professor
29 Web Apps in R: Build Interactive Histogram Web Application in R | Shiny Tutorial Ep 2
Web Apps in R: Build Interactive Histogram Web Application in R | Shiny Tutorial Ep 2
Data Professor
30 Web Apps in R: Building Data-Driven Web Application in R | Shiny Tutorial Ep 3
Web Apps in R: Building Data-Driven Web Application in R | Shiny Tutorial Ep 3
Data Professor
31 Web Apps in R: Building the Machine Learning Web Application in R | Shiny Tutorial Ep 4
Web Apps in R: Building the Machine Learning Web Application in R | Shiny Tutorial Ep 4
Data Professor
32 Web Apps in R: Build BMI Calculator web application in R for health monitoring | Shiny Tutorial Ep 5
Web Apps in R: Build BMI Calculator web application in R for health monitoring | Shiny Tutorial Ep 5
Data Professor
33 Machine Learning in R: Building a Linear Regression Model
Machine Learning in R: Building a Linear Regression Model
Data Professor
34 What programming language to learn for Data Science? R versus Python
What programming language to learn for Data Science? R versus Python
Data Professor
35 How to Become a Data Scientist (Learning Path and Skill Sets Needed)
How to Become a Data Scientist (Learning Path and Skill Sets Needed)
Data Professor
36 Using Python in R
Using Python in R
Data Professor
37 Interpretable Machine Learning Models
Interpretable Machine Learning Models
Data Professor
38 Making Scatter Plots in R [Data Visualisation in R series]
Making Scatter Plots in R [Data Visualisation in R series]
Data Professor
39 Machine Learning in Python: Building a Classification Model
Machine Learning in Python: Building a Classification Model
Data Professor
40 Compare Machine Learning Classifiers in Python
Compare Machine Learning Classifiers in Python
Data Professor
41 Hyperparameter Tuning of Machine Learning Model in Python
Hyperparameter Tuning of Machine Learning Model in Python
Data Professor
42 Practical Introduction to Google Colab for Data Science
Practical Introduction to Google Colab for Data Science
Data Professor
43 File Handling in Google Colab for Data Science
File Handling in Google Colab for Data Science
Data Professor
44 Pandas for Data Science: Create and Combine DataFrames / Rename Columns
Pandas for Data Science: Create and Combine DataFrames / Rename Columns
Data Professor
45 Machine Learning in Python: Building a Linear Regression Model
Machine Learning in Python: Building a Linear Regression Model
Data Professor
46 Machine Learning in Python: Principal Component Analysis (PCA) for Handling High-Dimensional Data
Machine Learning in Python: Principal Component Analysis (PCA) for Handling High-Dimensional Data
Data Professor
47 How to Plot an ROC Curve in Python | Machine Learning in Python
How to Plot an ROC Curve in Python | Machine Learning in Python
Data Professor
48 Installing conda on Google Colab for Data Science
Installing conda on Google Colab for Data Science
Data Professor
49 Use native R on Google Colab for Data Science
Use native R on Google Colab for Data Science
Data Professor
50 How to Save and Download files from Google Colab
How to Save and Download files from Google Colab
Data Professor
51 Easy Web Scraping in Python using Pandas for Data Science
Easy Web Scraping in Python using Pandas for Data Science
Data Professor
52 Data Science for Computational Drug Discovery using Python (Part 1)
Data Science for Computational Drug Discovery using Python (Part 1)
Data Professor
53 Pandas Profiling for Data Science (Quick and Easy Exploratory Data Analysis)
Pandas Profiling for Data Science (Quick and Easy Exploratory Data Analysis)
Data Professor
54 Exploratory Data Analysis in Python using pandas
Exploratory Data Analysis in Python using pandas
Data Professor
55 Quick tour of PyCaret (a low-code machine learning library in Python)
Quick tour of PyCaret (a low-code machine learning library in Python)
Data Professor
56 How to Upload Files to Google Colab
How to Upload Files to Google Colab
Data Professor
57 How to Install and Use Pandas Profiling on Google Colab
How to Install and Use Pandas Profiling on Google Colab
Data Professor
58 How to Adjust the Style of Pandas DataFrame
How to Adjust the Style of Pandas DataFrame
Data Professor
59 How to use Bamboolib for Data Wrangling in Data Science
How to use Bamboolib for Data Wrangling in Data Science
Data Professor
60 How to use Pandas Profiling on Kaggle
How to use Pandas Profiling on Kaggle
Data Professor

This video teaches how to build a data mining model from scratch using WEKA and the Iris flower dataset. It covers data pre-processing, constructing a prediction model, and evaluating its performance using a confusion matrix. The model achieves 96% accuracy and correctly classifies 144 out of 150 flowers.

Key Takeaways
  1. Click on the WEKA Explorer button
  2. Import the iris dataset from the C Drive
  3. Describe the dataset and its attributes
  4. Standardize the variables to have a minimum and maximum of 0 and 1
  5. Use the WEKA Explorer to build a prediction model
  6. Click on the classify tab
  7. Choose a classifier
  8. Select a decision tree classifier
  9. Click on the start button
  10. Split data set into training and testing
💡 Standardization is a crucial step in data pre-processing, and using a decision tree classifier with 10-fold cross-validation can achieve high accuracy in predicting the Iris flower species.

Related Reads

📰
The Builder’s Guide to Working With AI: Tools, Prompts, Automation, and Apps
Learn how to bridge the gap between talking about AI and building with it, with practical tools and techniques
Medium · AI
📰
Boost Your Productivity: Atlassian's AI-Powered Jira Revolution
Atlassian's AI-powered Jira boosts productivity with new tools and planning features, revolutionizing development workflows
Dev.to · Dave Kurian
📰
Selecting Your AI Tool Stack: A Three‑Layer Framework for Solo Travel Consultants
Learn a 3-layer framework to select the right AI tool stack for automating travel policy compliance checks and crisis contingency plan drafting as a solo corporate travel consultant
Dev.to AI
📰
How to prepare TIC teacher exams in Spain with AI (oposiciones 2026)
Prepare for Spain's 2026 TIC teacher exams using AI with these steps and tools
Dev.to AI
Up next
Codex (ChatGPT Work) Tutorial for Beginner: The AI Agent That Can Do More Than ChatGPT
AI Tool Journey
Watch →