תרגול - Decision Trees
תרגול - Decision Trees
!# = 1
!# − 1 = 0
!" !# = 0
0"
¡ Solution?
¡ If 1×!" + 1×!# − 1.5 > 0 predict 1
¡ Otherwise predict -1.
¡ i.e. ,- = −1.5, ," = 1, ,# = 1
*"
¡ Solution?
¡ !" + !# − 0.5 > 0 predict 1
¡ Otherwise -1
$"
¡ Solution?
¡ There is no solution
¡ Many functions cannot be represented using
a linear separator, i.e., they are not linearly
separable
© Ben Galili IDC
¡ We will talk about linear classifiers in future
recitation
¡ The problem with linear classifiers is that not
all the data is linear separable
¡ We need more ‘tools’ to deal with more
complex data
!#
!"
decision tree
34"4_3?4" = 5"=%$>?#4%"_3?4" =
Goodness |(A | |(A |
of split 34"45"678 ( − + 34"45"678 (A !"#$%&' ( − + !"#$%&' (A
|(| |(|
A∈CDEFGH(I) A∈CDEFGH(I)
D4 4 2 2 2 2
3 !"#$%&' D4 = −( .%/ + .%/
D 12 4 4 4 4
4∈6789:; FG?=HG>
5 2 2 3 3 3 1 1 2 2
+ .%/ + .%/ + .%/ + .%/ )
12 5 5 5 5 12 3 3 3 3