Machine Learning Decision Trees. Exercise Solutions.

Slides:



Advertisements
Similar presentations
COMP3740 CR32: Knowledge Management and Adaptive Systems
Advertisements

Introduction to Artificial Intelligence CS440/ECE448 Lecture 21
Machine Learning: Intro and Supervised Classification
Conceptual Clustering
CPSC 502, Lecture 15Slide 1 Introduction to Artificial Intelligence (AI) Computer Science cpsc502, Lecture 15 Nov, 1, 2011 Slide credit: C. Conati, S.
Iterative Dichotomiser 3 (ID3) Algorithm Medha Pradhan CS 157B, Spring 2007.
1 Machine Learning: Lecture 10 Unsupervised Learning (Based on Chapter 9 of Nilsson, N., Introduction to Machine Learning, 1996)
Machine learning learning... a fundamental aspect of intelligent systems – not just a short-cut to kn acquisition / complex behaviour.
Information Extraction Lecture 6 – Decision Trees (Basic Machine Learning) CIS, LMU München Winter Semester Dr. Alexander Fraser, CIS.
1 Lecture 35 Brief Introduction to Main AI Areas (cont’d) Overview  Lecture Objective: Present the General Ideas on the AI Branches Below  Introduction.
Supervised learning Given training examples of inputs and corresponding outputs, produce the “correct” outputs for new inputs Two main scenarios: –Classification:
1 Chapter 10 Introduction to Machine Learning. 2 Chapter 10 Contents (1) l Training l Rote Learning l Concept Learning l Hypotheses l General to Specific.
Learning: Identification Trees Larry M. Manevitz All rights reserved.
Decision Tree Learning
Basic Data Mining Techniques
Three kinds of learning
Learning….in a rather broad sense: improvement of performance on the basis of experience Machine learning…… improve for task T with respect to performance.
MACHINE LEARNING. 2 What is learning? A computer program learns if it improves its performance at some task through experience (T. Mitchell, 1997) A computer.
MACHINE LEARNING. What is learning? A computer program learns if it improves its performance at some task through experience (T. Mitchell, 1997) A computer.
International Graduate School of Dynamic Intelligent Systems Machine Learning RG Knowledge Based Systems Hans Kleine Büning 15 July 2015.
Information Theory, Classification & Decision Trees Ling 572 Advanced Statistical Methods in NLP January 5, 2012.
Data Mining and Decision Tree CS157B Spring 2006 Masumi Shimoda.
ID3 Algorithm Allan Neymark CS157B – Spring 2007.
Data Mining: Classification
Decision Trees Advanced Statistical Methods in NLP Ling572 January 10, 2012.
Copyright R. Weber Machine Learning, Data Mining ISYS370 Dr. R. Weber.
INTRODUCTION TO MACHINE LEARNING. $1,000,000 Machine Learning  Learn models from data  Three main types of learning :  Supervised learning  Unsupervised.
Learning CPSC 386 Artificial Intelligence Ellen Walker Hiram College.
EIE426-AICV1 Machine Learning Filename: eie426-machine-learning-0809.ppt.
LEARNING DECISION TREES Yılmaz KILIÇASLAN. Definition - I Decision tree induction is one of the simplest, and yet most successful forms of learning algorithm.
Learning from Observations Chapter 18 Through
CHAPTER 18 SECTION 1 – 3 Learning from Observations.
Learning from observations
CS 4100 Artificial Intelligence Prof. C. Hafner Class Notes March 27, 2012.
Learning with Decision Trees Artificial Intelligence CMSC February 20, 2003.
ID3 Algorithm Michael Crawford.
Searching by Authority Artificial Intelligence CMSC February 12, 2008.
1 Chapter 10 Introduction to Machine Learning. 2 Chapter 10 Contents (1) l Training l Rote Learning l Concept Learning l Hypotheses l General to Specific.
Decision Trees, Part 1 Reading: Textbook, Chapter 6.
Exercises Decision Trees In decision tree learning, the information gain criterion helps us select the best attribute to split the data at every node.
DECISION TREE Ge Song. Introduction ■ Decision Tree: is a supervised learning algorithm used for classification or regression. ■ Decision Tree Graph:
Learning with Decision Trees Artificial Intelligence CMSC February 18, 2003.
1 Classification: predicts categorical class labels (discrete or nominal) classifies data (constructs a model) based on the training set and the values.
Classification and Regression Trees
DECISION TREES Asher Moody, CS 157B. Overview  Definition  Motivation  Algorithms  ID3  Example  Entropy  Information Gain  Applications  Conclusion.
Chapter 18 Section 1 – 3 Learning from Observations.
Machine Learning in Practice Lecture 2 Carolyn Penstein Rosé Language Technologies Institute/ Human-Computer Interaction Institute.
Friday’s Deliverable As a GROUP, you need to bring 2N+1 copies of your “initial submission” –This paper should be a complete version of your paper – something.
Medical Decision Making Learning: Decision Trees Artificial Intelligence CMSC February 10, 2005.
DATA MINING TECHNIQUES (DECISION TREES ) Presented by: Shweta Ghate MIT College OF Engineering.
Anifuddin Azis LEARNING. Why is learning important? So far we have assumed we know how the world works Rules of queens puzzle Rules of chess Knowledge.
By N.Gopinath AP/CSE.  A decision tree is a flowchart-like tree structure, where each internal node (nonleaf node) denotes a test on an attribute, each.
Machine Learning with Spark MLlib
CIS, LMU München Winter Semester Dr. Alexander Fraser, CIS
Learning from Observations
Machine Learning Inductive Learning and Decision Trees
Iterative Dichotomiser 3 (ID3) Algorithm
Introduce to machine learning
Prepared by: Mahmoud Rafeek Al-Farra
Presented By S.Yamuna AP/CSE
Prof. Dr. Alexander Fraser, CIS
AV Autonomous Vehicles.
Classification and Prediction
Machine Learning Week 1.
Learning with Identification Trees
Classification by Decision Tree Induction
Supervised vs. unsupervised Learning
Lecture 6: Introduction to Machine Learning
CS639: Data Management for Data Science
Presentation transcript:

Machine Learning Decision Trees. Exercise Solutions

Exercise 1 a) Machine learning methods are often categorised in three main types: supervised, unsupervised and reinforcement learning methods. Explain these in not more than a sentence each and explain in which category does Decision Tree Learning fall and why?

Answer n Supervised learning is learning with a teacher, i.e. input-output examples are given to the system in the training phase. After training the system is asked to predict the output from new inputs. E.g. classification n Unsupervised learning is in fact learning for structure discovery with no teacher. Only input data are seen in both the training and the testing phase. E.g. ICA, clustering. n Reinforcement learning is learning with no teacher but with feedback from the environment. The feedback consists of rewards, which are typically delayed. E.g. Q-learning.  Decision Trees are supervised learning methods.They do classification based on given examples.

c) For the sunbathers example given in the lecture, calculate the Disorder function for the attribute ‘height’ at the root node.

Disorder of height Height is_sunburned Tall Average Short Alex Annie Katie Sarah Emily John Dana Pete

Disorder of height (contd) Alex Annie Katie Sarah Emily John

Exercise 2 n For the sunbathers example given in the lecture, calculate the Disorder function associated with the possible branches of the decision tree once the root node (hair colour) has been chosen.

Answer: 1 st branch Sarah Annie Dana Katie Hair colour is_sunburned Blonde HeightWeightLotion used Short Average Tall SarahAnnie Katie DanaSarah Katie Annie Dana AverageLight No Yes Sarah Annie Dana Katie

n So in this branch (1 st branch) we found the “Lotion Used” is the next attribute to split on n We also found that by doing that this branch is done. n The method of computation for the other 2 branches (red and brown) is exactly the same.

Exercise 3 n Using the decision tree learning algorithm, calculate the decision tree for the following data set

Data for Exercise 3

Ex 3: Search for Root. Candidate: Hair Colour Hair colour Blonde Brown Sarah Annie Dana Julie Ruth Alex Pete John is_sunburned Av Disorder = (5/8)* =

Height is_sunburned Tall Average Short Alex Annie Sarah Julie John Ruth Dana Pete Av Disorder = ¼ + 1/2 * = Ex 3: Search for Root. Candidate: Height

Weight is_sunburned Heavy Average Light Dana Alex Annie Sarah Julie Ruth Pete John Av Disorder = 2*(3/8)* = Ex 3: Search for Root. Candidate: Weight

Lotion used is_sunburned Yes No Dana Alex Sarah Annie Julie Pete John Ruth Av Disorder =(3/4)* = Ex 3: Search for Root. Candidate: Lotion

Ex 3: Next Dana Hair colour Blonde Brown Sarah Annie Dana Julie Ruth No is_sunburned Height Weight Lotion used ? ? ? Short Av Tall LightAv Heavy No Yes Annie Sarah Julie Ruth Dana Sarah Julie Ruth Dana Annie No Sarah Annie Julie Ruth

Ex 3: Next Hair colour Blonde Brown No is_sunburned Height Short Av Tall Yes No Sarah Julie Ruth No further split will improve the classification accuracy on the training data. We can assign a decision to this leaf node based on the majority. That gives a ‘No’.