Decision tree Construct a decision tree to classify “golf play.

Slides:



Advertisements
Similar presentations
DECISION TREES. Decision trees  One possible representation for hypotheses.
Advertisements

Decision Tree Approach in Data Mining
Data Mining Classification: Basic Concepts, Decision Trees, and Model Evaluation Lecture Notes for Chapter 4 Part I Introduction to Data Mining by Tan,
Decision Tree Algorithm (C4.5)
ICS320-Foundations of Adaptive and Learning Systems
Classification Techniques: Decision Tree Learning
Decision Tree Example MSE 2400 EaLiCaRA Spring 2015 Dr. Tom Way.
Decision Trees Instructor: Qiang Yang Hong Kong University of Science and Technology Thanks: Eibe Frank and Jiawei Han.
ID3 Algorithm Abbas Rizvi CS157 B Spring What is the ID3 algorithm? ID3 stands for Iterative Dichotomiser 3 Algorithm used to generate a decision.
Decision Tree Learning
Lazy Associative Classification By Adriano Veloso,Wagner Meira Jr., Mohammad J. Zaki Presented by: Fariba Mahdavifard Department of Computing Science University.
Decision Tree Learning Learning Decision Trees (Mitchell 1997, Russell & Norvig 2003) –Decision tree induction is a simple but powerful learning paradigm.
SEG Tutorial 1 – Classification Decision tree, Naïve Bayes & k-NN CHANG Lijun.
Machine Learning Lecture 10 Decision Trees G53MLE Machine Learning Dr Guoping Qiu1.
SEEM Tutorial 2 Classification: Decision tree, Naïve Bayes & k-NN
Naïve Bayes Classifier Ke Chen Extended by Longin Jan Latecki COMP20411 Machine Learning.
CS344: Introduction to Artificial Intelligence Pushpak Bhattacharyya CSE Dept., IIT Bombay Lecture 29 and 30– Decision Tree Learning; ID3;Entropy.
Machine Learning II 부산대학교 전자전기컴퓨터공학과 인공지능연구실 김민호
Classification and Prediction
Data Mining – Algorithms: Decision Trees - ID3 Chapter 4, Section 4.3.
CS690L Data Mining: Classification
Slide 1 DSCI 4520/5240: Data Mining Fall 2013 – Dr. Nick Evangelopoulos Lecture 5: Decision Tree Algorithms Material based on: Witten & Frank 2000, Olson.
DECISION TREE Ge Song. Introduction ■ Decision Tree: is a supervised learning algorithm used for classification or regression. ■ Decision Tree Graph:
Decision Trees Prof. Carolina Ruiz Dept. of Computer Science WPI.
SEEM Tutorial 1 Classification: Decision tree Siyuan Zhang,
Iterative Dichotomiser 3 By Christopher Archibald.
Review of Decision Tree Learning Bamshad Mobasher DePaul University Bamshad Mobasher DePaul University.
COMP24111 Machine Learning Naïve Bayes Classifier Ke Chen.
CSE573 Autumn /09/98 Machine Learning Administrative –Last topic: Decision Tree Learning Reading: 5.1, 5.4 Last time –finished NLP sample system’s.
CSE573 Autumn /11/98 Machine Learning Administrative –Finish this topic –The rest of the time is yours –Final exam Tuesday, Mar. 17, 2:30-4:20.
Decision Tree Learning
Weather Station Model.
DECISION TREES An internal node represents a test on an attribute.
Decision Trees an introduction.
Decision trees (concept learnig)
Machine Learning Lecture 2: Decision Tree Learning.
Data Science Algorithms: The Basic Methods
Decision trees (concept learnig)
Naïve Bayes Classifier
Classification Algorithms
Decision Tree Learning
CSE543: Machine Learning Lecture 2: August 6, 2014
Teori Keputusan (Decision Theory)
Prepared by: Mahmoud Rafeek Al-Farra
text processing And naïve bayes
Data Science Algorithms: The Basic Methods
Decision Trees: Another Example
Naïve Bayes Classifier
Divisibility Rules Practice 2, 5, or 10?
ID3 Vlad Dumitriu.
Data Science Algorithms: The Basic Methods
Naïve Bayes Classifier
Decision Tree Saed Sayad 9/21/2018.
Classification Techniques: Bayesian Classification
Naïve Bayes Classifier
Decision Trees Decision tree representation ID3 learning algorithm
Generative Models and Naïve Bayes

How decision tree is derived from a data set
Decision Trees Decision tree representation ID3 learning algorithm
Decision Tree Concept of Decision Tree
Generative Models and Naïve Bayes
75 previous answer What is of 37.5? ? go to.
Decision Tree  Decision tree is a popular classifier.
A task of induction to find patterns
Decision Tree  Decision tree is a popular classifier.
Data Mining CSCI 307, Spring 2019 Lecture 15
Decision Tree.
A task of induction to find patterns
75 previous answer What is of 60? ? go to.
Presentation transcript:

Decision tree Construct a decision tree to classify “golf play.

Answer First : we calculate the entropy for the data set class Info (D)= - 5/14 log2 (5/14) – 9/14 log2 (9/14) =0.530 +0.409 =0.939

Then : we calculate the entropy for the Attributes . infoweather (D) = 5/14 ( -2/5 log2 (2/5) - 3/5 log2 (3/5) ) + 4/14 (-4/4 log2 (4/4) ) + 5/14 ( -2/5 log2 (2/5) - 3/5 log2 (3/5) )= 0.346 +0+0.346 = 0.692 infotemp (D) = 4/14 ( -2/4 log2 (2/4) - 2/4 log2 (2/4) ) + 6/14 (-4/6 log2 (4/6) - 2/6 log2 (2/6) ) + 4/14 ( -3/4 log2 (3/4) - 1/4 log2 (1/4) )= 0.285 + 0.393 + 0.231 = 0.909 infohumidty (D) = 7/14 ( -4/7 log2 (4/7) - 3/7 log2 (3/7) ) + 7/14 (-6/7 log2 (6/7) - 1/7 log2 (1/7) ) = 0.492+ 0.295= 0.787 infowind (D) = 8/14 ( -6/8 log2 (6/8) - 2/8 log2 (2/8) ) + 6/14 (-3/6 log2 (3/6) - 3/6 log2 (3/6) ) = 0.463 + 0.428 = 0.891

Third : calculate the information Gain for each attributes . Gain (Weather)= 0.939 – 0.692 = 0.247 Gain (Temp)= 0.939 – 0.909 = 0.03 Gain (Humidity)= 0.939 – 0.787 = 0.152 Gain (Wind)= 0.939 – 0.891 = 0.048 The Weather is the higher information gain , then it will be the Root of the Tree. Weather Rain Yes Select Attributes ?? Fain Cloud

Then : Same previous steps but with just Rain rows So, Find the gain for the Rain branch .. The D will be 5. Info(D)= - 3/5 log2 (3/5) – 2/5 log2 (2/5) =0.442+ 0.528 =0.97 infotemp (D) = 3/5 ( -2/3 log2 (2/3) - 1/3 log2 (1/3) ) + 2/5 (-1/2 log2 (1/2) - 1/2 log2 (1/2) =0.595+ 0.4= 0.95 infohumidty (D) = 2/5 (-1/2 log2 (1/2) - 1/2 log2 (1/2) + 3/5 ( -2/3 log2 (3/3) - 1/3 log2 (1/3) ) =0.95 infowind (D) = = 2/5 (-2/2 log2 (2/2) )+ 3/5 ( -3/3 log2 (3/3)) =0

Gain (Temp)= 0.97– 0.95 = 0.02 Gain (Humidity)= 0.97 – 0.95 = 0.02 Gain (Wind)= 0.97 – 0 = 0.97 The Wind is the higher information gain , then it will be the internal node of the Rain brache. Weather Rain Yes Select Attributes ?? Wind No Few none Fain Cloud

Next : Find the gain for the fain branch .. The D will be 5. Info(D)= - 3/5 log2 (3/5) – 2/5 log2 (2/5) =0.442+ 0.528 =0.97 infotemp (D) = 2/5 ( -1/2 log2 (1/2) - 1/2 log2 (1/2) ) + 2/5 (-2/2 log2 (2/2))+1/5 (-1/1 log2 (1/1 ) ) =0.4 infohumidty (D) = 3/5 (-3/3 log2 (3/3)) + 2/5 ( -2/2 log2 (2/2)) = 0 Gain (Temp)= 0.97– 0.4 =0.57 Gain (Humidity)= 0.97 – 0 = 0.97 The Humidity is the higher information gain , then it will be the internal node of the fain brache.

Weather Rain Yes Wind Few none Fain Cloud Humidity High Medium No Yes

Naïve Bayes What is the class of : X=((Weather=rain), (temperature=cold), (humidity=high) and (windy=few))

P(Yes) = 9/14 =0.642 , P(NO)= 5/14 = 0.357 P(Rain | Yes) = 3/9 , P(Rain | No) = 2/5 P(Cold | Yes) = 3/9 , P(Cold | No) = 1/5 P(High | Yes) = 3/9 , P(High | No) = 4/5 P(Few | Yes) = 3/9 , P(Few | No) = 3/5 P(X | Yes) = 3/9* 3/9* 3/9* 3/9 =0.012 P(X | No) = 2/5* 1/5* 4/5* 3/5 =0.038 P(Yes | X ) = P(X | Yes) * P(Yes) = 0.012*0.642= 0.077 P(No | X ) = P(X | No) * P(No) = 0.038*0.357 =0.013 So, the X will be in class Yes

Rule based Based on the following decision tree of play golf or not , extract set of rules.

Weather Rain Yes Wind No Few none Fine Cloud Humidity High Medium No Yes

Answer If (Weather= Rain) ^ (wind=few)->Golf play=yes If (Weather= Rain) ^ (wind=none)->Golf play=No If (Weather=Cloud)->Golf play=yes If (Weather=fine) ^ (Humidity=High)->Golf play=No If (Weather=fine) ^ (Humidity=Medium)->Golf play=yes

Find the class of the following records: ( the default class is Yes): (Weather= Rain) ^ (wind=few)->yes (Weather= Cloud) ^ (wind=few)->yes (Weather= Fine) ^ (Humidity=High)->No (Weather= Fine) ^ (Humidity=Low)-> deafult class= yes