25
1 By: Ashmi Banerjee (125186) Suman Datta (1251132) CSE- 3rd year. DECISION TREE

DECISION TREE 1

Embed Size (px)

Citation preview

Page 1: DECISION TREE 1

1

By: Ashmi Banerjee (125186) Suman Datta (1251132) CSE- 3rd year.

DECISION TREE

Page 2: DECISION TREE 1

INTRODUCTION TO DECISION TREES

2

Decision tree learning is one of the most widely used and practical methods forinductive inference. It is a method for approximating discrete-valued functions that is robust to noisy data and capable of learning disjunctive expressions.

These learning methods are among the most popular of inductive inference algorithms and have been successfully applied to a broad range of tasks from learning to diagnose medical cases to learning to assess credit risk of loan applicants.

Page 3: DECISION TREE 1

DECISION TREE REPRESENTATION

3

A decision tree is a classification model whose structure consists of a number of nodes and arcs.In general, a node is labelled by an attribute name, and an arc by a valid value of the attribute associated with the node from which the arc originates.

The top-most node is called the root of the tree, and the bottom nodes are called the leaves.Each leaf is labelled by a class (value of the class attribute).

When used for classification, a decision tree is traversed in a top-down manner, following the arcs with attribute values satisfying the instance that is to be classified.

The traversal of the tree leads to a leaf node and the instance is assigned the class label of the leaf.

Page 4: DECISION TREE 1

4

Page 5: DECISION TREE 1

5

Page 6: DECISION TREE 1

TYPES OF ATTRIBUTES

6

1.Binary Attributes 2.Nominal Attributes3.Ordinal4.Continuous

Page 7: DECISION TREE 1

7

The test condition for a binary attribute generates two potential outcomes.

BINARY ATTRIBUTES

Page 8: DECISION TREE 1

8

NOMINAL ATTRIBUTESIt can have many values. It can be split into multiple subgroups depending on the number of distinct values corresponding to the attribute.

Page 9: DECISION TREE 1

9

ORDINAL ATTRIBUTESOrdinal attributes can also produce binary or multi way splits. They can be grouped as long as the grouping does not violate the order property of the attribute value.

Page 10: DECISION TREE 1

An Illustrative Example

To illustrate a decision tree, consider the learning task represented by the training examples of the following table. Here the target attribute PlayTennis, which can have values yes or no for different Saturday mornings, is to be predicted based on other attributes of the morning in question.

10

Page 11: DECISION TREE 1

An Illustrative EXAMPLE contd..

11

Page 12: DECISION TREE 1

A model Decision Tree based on the Data

12

Page 13: DECISION TREE 1

BUT IS OUR MODEL A GOOD ONE????Will it predict correctly for all data??

13

Page 14: DECISION TREE 1

MEASURES FOR SELECTING THE BEST FIT

14

Page 15: DECISION TREE 1

15

The smaller the degree of impurities in the leaf nodes the skewed is the classification. The impurities can be measured as:

Page 16: DECISION TREE 1

16

Page 17: DECISION TREE 1

17

Page 18: DECISION TREE 1

18

Page 19: DECISION TREE 1

19

Humidity provides greater information gain than Wind, relative to the target classification. Here, E stands for entropy and S for the original collection of examples. Given an initial collection S of 9 positive and 5 negative examples, [9+, 5-], sorting these by their Humidity produces collections of [3+, 4-1 (Humidity = High) and [6+, 1-] (Humidity = Normal). The information gained by this partitioning is .151, compared to a gain of only .048 for the attribute Wind.

Page 20: DECISION TREE 1

20

Page 21: DECISION TREE 1

21

Page 22: DECISION TREE 1

22

Page 23: DECISION TREE 1

23

Page 24: DECISION TREE 1

24

An Exercise

Page 25: DECISION TREE 1

25

Thank you !