Wentworth Institute of Technology COMP4050 – Machine Learning | Fall 2015 | Derbinsky
Supervised Learning via Decision Trees
Lecture 4
October 13, 2015 Supervised Learning via Decision Trees 1
Supervised Learning via Decision Trees Lecture 4 Supervised - - PowerPoint PPT Presentation
Wentworth Institute of Technology COMP4050 Machine Learning | Fall 2015 | Derbinsky Supervised Learning via Decision Trees Lecture 4 Supervised Learning via Decision Trees October 13, 2015 1 Wentworth Institute of Technology COMP4050
Wentworth Institute of Technology COMP4050 – Machine Learning | Fall 2015 | Derbinsky
October 13, 2015 Supervised Learning via Decision Trees 1
Wentworth Institute of Technology COMP4050 – Machine Learning | Fall 2015 | Derbinsky
October 13, 2015 Supervised Learning via Decision Trees 2
Wentworth Institute of Technology COMP4050 – Machine Learning | Fall 2015 | Derbinsky
choice nodes from root to a leaf node
– Each choice node splits on a single feature
classification or regression
understand
prediction time
October 13, 2015 Supervised Learning via Decision Trees 3
h"ps://en.wikipedia.org/wiki/Decision_tree_learning
Wentworth Institute of Technology COMP4050 – Machine Learning | Fall 2015 | Derbinsky
October 13, 2015 Supervised Learning via Decision Trees 4
Wentworth Institute of Technology COMP4050 – Machine Learning | Fall 2015 | Derbinsky
October 13, 2015 Supervised Learning via Decision Trees 5
Wentworth Institute of Technology COMP4050 – Machine Learning | Fall 2015 | Derbinsky
October 13, 2015 Supervised Learning via Decision Trees 6
Wentworth Institute of Technology COMP4050 – Machine Learning | Fall 2015 | Derbinsky
October 13, 2015 Supervised Learning via Decision Trees 7
Wentworth Institute of Technology COMP4050 – Machine Learning | Fall 2015 | Derbinsky
October 13, 2015 Supervised Learning via Decision Trees 8
Wentworth Institute of Technology COMP4050 – Machine Learning | Fall 2015 | Derbinsky
October 13, 2015 Supervised Learning via Decision Trees 9
Wentworth Institute of Technology COMP4050 – Machine Learning | Fall 2015 | Derbinsky
October 13, 2015 Supervised Learning via Decision Trees 10
Wentworth Institute of Technology COMP4050 – Machine Learning | Fall 2015 | Derbinsky
October 13, 2015 Supervised Learning via Decision Trees 11
Wentworth Institute of Technology COMP4050 – Machine Learning | Fall 2015 | Derbinsky
October 13, 2015 Supervised Learning via Decision Trees 12
Wentworth Institute of Technology COMP4050 – Machine Learning | Fall 2015 | Derbinsky
October 13, 2015 Supervised Learning via Decision Trees 13
Base Case Recursive Step
Wentworth Institute of Technology COMP4050 – Machine Learning | Fall 2015 | Derbinsky
October 13, 2015 Supervised Learning via Decision Trees 14
Wentworth Institute of Technology COMP4050 – Machine Learning | Fall 2015 | Derbinsky
October 13, 2015 Supervised Learning via Decision Trees 15
main print factorial_r( 4 ) factorial_r return 4 * factorial_r( 3 ) factorial_r return 3 * factorial_r( 2 ) factorial_r return 2 * factorial_r( 1 ) factorial_r return 1 * factorial_r( 0 ) factorial_r return 1 Func%on Stack Stack Frame
Wentworth Institute of Technology COMP4050 – Machine Learning | Fall 2015 | Derbinsky
October 13, 2015 Supervised Learning via Decision Trees 16
main print factorial_r( 4 ) factorial_r return 4 * factorial_r( 3 ) factorial_r return 3 * factorial_r( 2 ) factorial_r return 2 * factorial_r( 1 ) factorial_r return 1 * 1 Func%on Stack Stack Frame
Wentworth Institute of Technology COMP4050 – Machine Learning | Fall 2015 | Derbinsky
October 13, 2015 Supervised Learning via Decision Trees 17
main print factorial_r( 4 ) factorial_r return 4 * factorial_r( 3 ) factorial_r return 3 * factorial_r( 2 ) factorial_r return 2 * 1 Func%on Stack Stack Frame
Wentworth Institute of Technology COMP4050 – Machine Learning | Fall 2015 | Derbinsky
October 13, 2015 Supervised Learning via Decision Trees 18
main print factorial_r( 4 ) factorial_r return 4 * factorial_r( 3 ) factorial_r return 3 * 2 Func%on Stack Stack Frame
Wentworth Institute of Technology COMP4050 – Machine Learning | Fall 2015 | Derbinsky
October 13, 2015 Supervised Learning via Decision Trees 19
main print factorial_r( 4 ) factorial_r return 4 * 6 Func%on Stack Stack Frame
Wentworth Institute of Technology COMP4050 – Machine Learning | Fall 2015 | Derbinsky
October 13, 2015 Supervised Learning via Decision Trees 20
main print 24 Func%on Stack Stack Frame
Wentworth Institute of Technology COMP4050 – Machine Learning | Fall 2015 | Derbinsky
October 13, 2015 Supervised Learning via Decision Trees 21
Recursive Step Base Cases
Wentworth Institute of Technology COMP4050 – Machine Learning | Fall 2015 | Derbinsky
– Goal: choose splits that proceed from much->little uncertainty
October 13, 2015 Supervised Learning via Decision Trees 22
h"p://www.saedsayad.com/ decision_tree_reg.htm
Wentworth Institute of Technology COMP4050 – Machine Learning | Fall 2015 | Derbinsky
October 13, 2015 Supervised Learning via Decision Trees 23
Wentworth Institute of Technology COMP4050 – Machine Learning | Fall 2015 | Derbinsky
October 13, 2015 Supervised Learning via Decision Trees 24
Wentworth Institute of Technology COMP4050 – Machine Learning | Fall 2015 | Derbinsky
October 13, 2015 Supervised Learning via Decision Trees 25
Expected value of informaCon
Wentworth Institute of Technology COMP4050 – Machine Learning | Fall 2015 | Derbinsky
October 13, 2015 Supervised Learning via Decision Trees 26
Wentworth Institute of Technology COMP4050 – Machine Learning | Fall 2015 | Derbinsky
October 13, 2015 Supervised Learning via Decision Trees 27
Log Base = Units: 2=bit (binary digit), 3=trit, e=nat
Log Base = Units: 2=shannon/bit
Wentworth Institute of Technology COMP4050 – Machine Learning | Fall 2015 | Derbinsky
October 13, 2015 Supervised Learning via Decision Trees 28
Wentworth Institute of Technology COMP4050 – Machine Learning | Fall 2015 | Derbinsky
October 13, 2015 Supervised Learning via Decision Trees 29
Wentworth Institute of Technology COMP4050 – Machine Learning | Fall 2015 | Derbinsky
October 13, 2015 Supervised Learning via Decision Trees 30
Wentworth Institute of Technology COMP4050 – Machine Learning | Fall 2015 | Derbinsky
October 13, 2015 Supervised Learning via Decision Trees 31
Wentworth Institute of Technology COMP4050 – Machine Learning | Fall 2015 | Derbinsky
October 13, 2015 Supervised Learning via Decision Trees 32
Wentworth Institute of Technology COMP4050 – Machine Learning | Fall 2015 | Derbinsky
October 13, 2015 Supervised Learning via Decision Trees 33
Wentworth Institute of Technology COMP4050 – Machine Learning | Fall 2015 | Derbinsky
October 13, 2015 Supervised Learning via Decision Trees 34
Wentworth Institute of Technology COMP4050 – Machine Learning | Fall 2015 | Derbinsky
October 13, 2015 Supervised Learning via Decision Trees 35
Wentworth Institute of Technology COMP4050 – Machine Learning | Fall 2015 | Derbinsky
October 13, 2015 Supervised Learning via Decision Trees 36
Average Entropy of the children
Wentworth Institute of Technology COMP4050 – Machine Learning | Fall 2015 | Derbinsky
October 13, 2015 Supervised Learning via Decision Trees 37
Wentworth Institute of Technology COMP4050 – Machine Learning | Fall 2015 | Derbinsky
October 13, 2015 Supervised Learning via Decision Trees 38
Wentworth Institute of Technology COMP4050 – Machine Learning | Fall 2015 | Derbinsky
October 13, 2015 Supervised Learning via Decision Trees 39
X Y Z Class 1 1 1 A 1 1 A 1 B 1 B
Wentworth Institute of Technology COMP4050 – Machine Learning | Fall 2015 | Derbinsky
October 13, 2015 Supervised Learning via Decision Trees 40
X Y Z Class 1 1 1 A 1 1 A 1 B 1 B
Wentworth Institute of Technology COMP4050 – Machine Learning | Fall 2015 | Derbinsky
October 13, 2015 Supervised Learning via Decision Trees 41
X Y Z Class 1 1 1 A 1 1 A 1 B 1 B
Wentworth Institute of Technology COMP4050 – Machine Learning | Fall 2015 | Derbinsky
October 13, 2015 Supervised Learning via Decision Trees 42
X Y Z Class 1 1 1 A 1 1 A 1 B 1 B
Wentworth Institute of Technology COMP4050 – Machine Learning | Fall 2015 | Derbinsky
October 13, 2015 Supervised Learning via Decision Trees 43
X Y Z Class 1 1 1 A 1 1 A 1 B 1 B
Wentworth Institute of Technology COMP4050 – Machine Learning | Fall 2015 | Derbinsky
October 13, 2015 Supervised Learning via Decision Trees 44
0.311 1.0 0.0 X Y Z Class 1 1 1 A 1 1 A 1 B 1 B Y A B 1
Wentworth Institute of Technology COMP4050 – Machine Learning | Fall 2015 | Derbinsky
October 13, 2015 Supervised Learning via Decision Trees 45
Wentworth Institute of Technology COMP4050 – Machine Learning | Fall 2015 | Derbinsky
No Surfacing Flippers? Fish? Yes Yes Yes Yes Yes Yes Yes No No No Yes No No Yes No
October 13, 2015 Supervised Learning via Decision Trees 46
Wentworth Institute of Technology COMP4050 – Machine Learning | Fall 2015 | Derbinsky
No Surfacing Flippers? Fish? Yes Yes Yes Yes Yes Yes Yes No No No Yes No No Yes No
October 13, 2015 Supervised Learning via Decision Trees 47
Wentworth Institute of Technology COMP4050 – Machine Learning | Fall 2015 | Derbinsky
No Surfacing Flippers? Fish? Yes Yes Yes Yes Yes Yes Yes No No No Yes No No Yes No
October 13, 2015 Supervised Learning via Decision Trees 48
Wentworth Institute of Technology COMP4050 – Machine Learning | Fall 2015 | Derbinsky
No Surfacing Flippers? Fish? Yes Yes Yes Yes Yes Yes Yes No No No Yes No No Yes No
October 13, 2015 Supervised Learning via Decision Trees 49
Wentworth Institute of Technology COMP4050 – Machine Learning | Fall 2015 | Derbinsky
Flippers? Fish? Yes Yes Yes Yes No No
October 13, 2015 Supervised Learning via Decision Trees 50
Flippers? Fish? Yes No Yes No No Surfacing No Yes
Wentworth Institute of Technology COMP4050 – Machine Learning | Fall 2015 | Derbinsky
October 13, 2015 Supervised Learning via Decision Trees 51
Flippers? Fish? Yes No Yes No
Wentworth Institute of Technology COMP4050 – Machine Learning | Fall 2015 | Derbinsky
Flippers? Fish? Yes Yes Yes Yes No No
October 13, 2015 Supervised Learning via Decision Trees 52
No Surfacing No Yes No
Wentworth Institute of Technology COMP4050 – Machine Learning | Fall 2015 | Derbinsky
October 13, 2015 Supervised Learning via Decision Trees 53
Flippers? Fish? Yes Yes Yes Yes No No
Wentworth Institute of Technology COMP4050 – Machine Learning | Fall 2015 | Derbinsky
October 13, 2015 Supervised Learning via Decision Trees 54
Fish? No Flippers No Yes Fish? Yes Yes
Wentworth Institute of Technology COMP4050 – Machine Learning | Fall 2015 | Derbinsky
October 13, 2015 Supervised Learning via Decision Trees 55
Fish? No
Wentworth Institute of Technology COMP4050 – Machine Learning | Fall 2015 | Derbinsky
October 13, 2015 Supervised Learning via Decision Trees 56
Flippers No Yes Fish? Yes Yes No
Wentworth Institute of Technology COMP4050 – Machine Learning | Fall 2015 | Derbinsky
October 13, 2015 Supervised Learning via Decision Trees 57
Fish? Yes Yes
Wentworth Institute of Technology COMP4050 – Machine Learning | Fall 2015 | Derbinsky
October 13, 2015 Supervised Learning via Decision Trees 58
Flippers No Yes No Yes
Wentworth Institute of Technology COMP4050 – Machine Learning | Fall 2015 | Derbinsky
October 13, 2015 Supervised Learning via Decision Trees 59
No Surfacing No Yes No Flippers No Yes No Yes
No Surfacing Flippers? Fish? Yes Yes Yes Yes Yes Yes Yes No No No Yes No No Yes No
Wentworth Institute of Technology COMP4050 – Machine Learning | Fall 2015 | Derbinsky
October 13, 2015 Supervised Learning via Decision Trees 60 Fish? Yes Yes No No No
No
Wentworth Institute of Technology COMP4050 – Machine Learning | Fall 2015 | Derbinsky
October 13, 2015 Supervised Learning via Decision Trees 61
Wentworth Institute of Technology COMP4050 – Machine Learning | Fall 2015 | Derbinsky
October 13, 2015 Supervised Learning via Decision Trees 62
Wentworth Institute of Technology COMP4050 – Machine Learning | Fall 2015 | Derbinsky
October 13, 2015 Supervised Learning via Decision Trees 63
Wentworth Institute of Technology COMP4050 – Machine Learning | Fall 2015 | Derbinsky
October 13, 2015 Supervised Learning via Decision Trees 64
Wentworth Institute of Technology COMP4050 – Machine Learning | Fall 2015 | Derbinsky
October 13, 2015 Supervised Learning via Decision Trees 65
Wentworth Institute of Technology COMP4050 – Machine Learning | Fall 2015 | Derbinsky
October 13, 2015 Supervised Learning via Decision Trees 66