Docsity

Decision Tree Part 2-Data Warehouse-Lecture Slides, Slides of Data Warehousing

Toggle sidebar
bg1
2
7
Decision Rules
Decision Trees produce interpretable output in human-
readable form
Decision Rules constructed directly from Decision Tree
output, traversing path from root node to a given leaf node
Decision Rules have form IF antecedent THEN consequent
Antecedent consists of attributes values from branches of
given path
Consequent is classification of records contained in particular
leaf node, corresponding to path
docsity.com
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18

Partial preview of the text

Download Decision Tree Part 2-Data Warehouse-Lecture Slides and more Slides Data Warehousing in PDF only on Docsity!

Decision Rules Decision Trees produce interpretable output in human-readable form Decision Rules constructed directly from Decision Treeoutput, traversing path from root node to a given leaf node Decision Rules have form IF antecedent THEN consequent Antecedent consists of attributes values from branches ofgiven path Consequent is classification of records contained in particularleaf node, corresponding to path

Decision Rules^

( cont’d )

Recall the full decision tree produced by C4.5. Table below showsDecision Rules associated with tree^ Antecedent^ Support of decision rule shows proportion of records in training set restingin leaf node Confidence is percentage of records in leaf node, for which decision ruleis true Although confidence levels reported = 100%, results not typical of real-world examples

Consequent^ Support^ Confidence If assets = low then^ bad credit risk.^ 2/8^ 1.00If assets = high then good credit risk.^ 2/8^ 1. If^ assets = medium^ and^ savings^ =^ low^ then

good credit risk.^ 1/8^ 1. If^ assets = medium^ and^ savings^ =^ medium^ then

good credit risk.^ 2/8^ 1. If^ assets = medium^ and^ savings^ =^ high^ then

bad credit risk.^ 1/8^ 1.

Classification and Regression Trees

( cont’d )

Optimality measure maximizes split over all possible splits, atnode^ t

tj tj t

P

tj tj t

tt tt t P t P P

R LL RR

where,and nodeofnodechildleft L nodeofnodechildright R atrecordsofnumber L  L setgin traininrecordsofnumberatrecordsofnumber R setgin traininrecordsofnumberatrecordsclassofnumber)|(atrecordsofnumberatrecordsclassofnumber)|(^ ^ atrecordsofnumber

Classification and Regression Trees

( cont’d )

Example^ Predict whether customer is classified “Good” or “Bad” credit risk usingthree predictor fields, according to data below^ All records enter root node, and CART evaluates possible binary splits^ Customer^ Savings^ Assets

Income ($1000s)^ Credit Risk 1 Medium High 75 Good 2 Low Low 50 Bad 3 High Medium^25 Bad 4 Medium Medium^50 Good 5 Low Medium^100 Good 6 High High 25 Good 7 Low Low 25 Bad 8 Medium Medium^75 Good

Classification and Regression Trees

( cont’d )

Classification and Regression Trees

( cont’d )

Optimality measure maximized to 0.6248, when

Assets^ = “Low”

(Left branch),^ Assets^ = “Medium or High” (Right branch) Left branch terminates to pure leaf node; both records have targetvalue = “Bad Risk” Right branch diverse and calls for further partitioning

Assets = Medium or High Root Node (All Records)Assets = Low, Medium, High?Assets = Low Bad RiskDecision Node A(Records 1, 3, 4, 5, 6, 8) (Records 2, 7)

CART decision tree after decision node

A split docsity.com

Classification and Regression Trees

( cont’d )

Additional Data Partitions Using CART^ CART grows full tree by iterating twice more. Creates candidate splits,and splits records at decision node according to optimality measure

Assets = Medium or High Root Node (All Records)Assets = Low, Medium, High?Assets = Low Bad RiskDecision Node A(Records 2, 7)(Records 1, 3, 4, 5, 6, 8)Savings = High^ Savings = Low or MediumDecision Node BGood Risk(Records 3, 6)(Records 1, 4, 5, 8)Assets = MediumAssets = High^ Good RiskBad Risk(Records 6)(Records 3)

Classification and Regression Trees

( cont’d )

When is component^ Q (s|t) large?^ Q (s|t) maximized when proportions of records in child nodes as differentas possible^ Maximum occurs when, for each class value, two child nodes pure^ Credit Risk^ = “Good” or “Bad”;

k^ = 2 maximum possible value for

component

valueclasseachacrossmaximized

# classes )|()|(|Let(2) tjPtjPt)Q(s  RL^1 j  betweendistancewhen thelargeis| t)Q(s is)|(and)|( tjPtjP^ RL

Classification and Regression Trees

( cont’d )

What is maximum value for 2P

LPR?

Component maximized when proportion of records in P

L^ and PR^ branches

equal Optimality measure favors balanced splits of records between left andright branches Theoretical maximum is 2(0.5)(0.5) = 0.

Classification and Regression Trees

( cont’d ) Probability that record in leaf node classified correctly (as “Bad”) is 3/5 =0.60 = 60% Classification error rate for leaf node is 0.40 = 40%. 2/5 “Good” recordsclassified incorrectly (“Bad”) CART calculates classification error rate for tree this way Each leaf node weighted proportionally to number of records it contains

Pruning^ Subset of records to partition becomes smaller^ Data less representative of training set population

Classification and Regression Trees

( cont’d )

Fully grown tree has lowest classification errorrate However, resulting model overfits training set CART^ avoids^ memorizing

training^ set^ by

pruning^ nodes^ and

branches^ that^

reduce

generalizability CART^ algorithm^ finds

adjusted^ classification

error rate that penalizes tree for having too manyleaf nodes (too much complexity)

Test DataLife InsuranceCredit Card Income RangePromotionInsurance^

Gender^ Age

40-50K^ No^

No^ Male^42

20-30K^ No^

No^ Male^27

30-40K^ No^

No^ Male^43

20-30K^ Yes^

No^ Male^29 docsity.com

ExampleAttributes^

Classes

Gender^ CarTravel Costownership($)/km

Income Level^ Transportation mode

Male^0 Cheap^

Low^ Bus Male^1 Cheap^

Medium^ Bus Female^1 Cheap^

Medium^ Train Female^0 Cheap^

Low^ Bus Male^1 Cheap^

Medium^ Bus Male^0 Standard^

Medium^ Train Female^1 Standard^

Medium^ Train Female^1 Expensive^

High^ Car Male^2 Expensive^

Medium^ Car Female^2 Expensive^

High^ Car