Docsity

Machine Learning in Real World - Minning Data - Lecture Slides, Slides of Computer Fundamentals

Partial preview of the text

Download Machine Learning in Real World - Minning Data - Lecture Slides and more Slides Computer Fundamentals in PDF only on Docsity!

Machine Learning in Real

World

Docsity.com

Outline

• Handling Numeric Attributes

– Finding Best Split(s)

• Dealing with Missing Values

• Pruning

– Pre-pruning, Post-pruning, Error Estimates

• From Trees to Rules

Docsity.com

C4.5 History

• ID3, CHAID – 1960s

• C4.5 innovations (Quinlan):

  • permit numeric attributes
  • deal sensibly with missing values
  • pruning to deal with for noisy data

• C4.5 - one of best-known and most widely-used learning

algorithms

  • Last research version: C4.8, implemented in Weka as J4.8 (Java)
  • Commercial successor: C5.0 (available from Rulequest) 4

Docsity.com

Numeric attributes

• Standard method: binary splits

  • E.g. temp < 45

• Unlike nominal attributes,

every attribute has many possible split points

• Solution is straightforward extension:

  • Evaluate info gain (or other measure) for every possible split point of attribute
  • Choose “best” split point
  • Info gain for best split point is info gain for attribute

• Computationally more demanding

witten & eibe Docsity.com

Weather data - numeric

Outlook Temperature Humidity Windy Play Sunny 85 85 False No Sunny 80 90 True No Overcast 83 86 False Yes Rainy 75 80 False Yes … … … … … If outlook = sunny and humidity > 83 then play = no If outlook = rainy and windy = true then play = no If outlook = overcast then play = yes If humidity < 85 then play = yes If none of the above then play = yes

Docsity.com

Example

• Split on temperature attribute:

  • E.g. temperature < 71.5: yes/4, no/ temperature ≥ 71.5: yes/5, no/
  • Info([4,2],[5,3]) = 6/14 info([4,2]) + 8/14 info([5,3]) = 0.939 bits

• Place split points halfway between values

• Can evaluate all split points in one pass!

Yes No Yes Yes Yes No No Yes Yes Yes No Yes Yes No

witten & eibe Docsity.com

More speeding up

• Entropy only needs to be evaluated between points of

different classes (Fayyad & Irani, 1992)

Yes No Yes Yes Yes No No Yes Yes Yes No Yes Yes No

Potential optimal breakpoints

Breakpoints between values of the same class cannot

be optimal

value class X

Docsity.com

Binary vs. multi-way splits

• Splitting (multi-way) on a nominal attribute exhausts all

information in that attribute

  • Nominal attribute is tested (at most) once on any path in the tree

• Not so for binary splits on numeric attributes!

  • Numeric attribute may be tested several times along a path in the tree

• Disadvantage: tree is hard to read

• Remedy:

  • pre-discretize numeric attributes, or
  • use multi-way splits instead of binary ones 11

witten & eibe Docsity.com

Missing values - advanced

Split instances with missing values into pieces

  • A piece going down a branch receives a weight proportional to the popularity of the branch
  • weights sum to 1

• Info gain works with fractional instances

  • use sums of weights instead of counts

• During classification, split the instance into pieces in

the same way

  • Merge probability distribution using weights 13

witten & eibe Docsity.com

Pruning

• Goal: Prevent overfitting to noise in the

data

• Two strategies for “pruning” the decision

tree:

 Postpruning - take a fully-grown decision tree

and discard unreliable parts

 Prepruning - stop growing a branch when

information becomes unreliable

• Postpruning preferred in practice—

prepruning can “stop too early”

Docsity.com

Early stopping

• Pre-pruning may stop the growth process prematurely:

early stopping

• Classic example: XOR/Parity-problem

  • No individual attribute exhibits any significant association to the class
  • Structure is only visible in fully expanded tree
  • Pre-pruning won’t expand the root node

• But: XOR-type problems rare in practice

• And: pre-pruning faster than post-pruning

a b class

witten & eibe Docsity.com

Post-pruning

  • First, build full tree
  • Then, prune it
    • Fully-grown tree shows all attribute interactions
  • Problem: some subtrees might be due to chance effects
  • Two pruning operations: 1. Subtree replacement 2. Subtree raising
  • Possible strategies:
    • error estimation
    • significance testing
    • MDL principle 17

witten & eibe Docsity.com

Subtree replacement, 2

What subtree can we replace?

Docsity.com

Subtree replacement, 3

  • Bottom-up
  • Consider replacing a tree only after considering all its subtrees 20

witten & eibe Docsity.com