1.
4
Our First Machine Learning Classi er
Part 6 (Optional): Perceptron Decision Boundary
Sebastian Raschka and the Lightning AI Team
1
fi
Decision boundary
Sebastian Raschka Deep Learning Fundamentals, Unit 1 Lightning AI
2
How do we compute the decision boundary?
Sebastian Raschka Deep Learning Fundamentals, Unit 1 Lightning AI
3
x1 × w1 + x2 × w2 + b =z
Sebastian Raschka Deep Learning Fundamentals, Unit 1 Lightning AI
4
x1 × w1 + x2 × w2 + b =z
b
x1
w1 Compute
value If z>0
x2 w2 z else
if z ≤0
Sebastian Raschka Deep Learning Fundamentals, Unit 1 Lightning AI
5
Set equal to 0, because 0 is the decision threshold
x1 × w1 + x2 × w2 + b =0
Sebastian Raschka Deep Learning Fundamentals, Unit 1 Lightning AI
6
Want to be able to compute one x2 value given x1
x1 × w1 + x2 × w2 + b =0
Sebastian Raschka Deep Learning Fundamentals, Unit 1 Lightning AI
7
Decision boundary
Sebastian Raschka Deep Learning Fundamentals, Unit 1 Lightning AI
8
Subtract
( )
x1 × w1 + x2 × w2 + b =0
Sebastian Raschka Deep Learning Fundamentals, Unit 1 Lightning AI
9
x2 × w2 + b =− x1 × w1
Sebastian Raschka Deep Learning Fundamentals, Unit 1 Lightning AI
10
Subtract
x2 × w2 + b =− x1 × w1
Sebastian Raschka Deep Learning Fundamentals, Unit 1 Lightning AI
11
x2 × w2 = − x1 × w1 − b
Sebastian Raschka Deep Learning Fundamentals, Unit 1 Lightning AI
12
Divide
x2 × w2 = − x1 × w1 − b
Sebastian Raschka Deep Learning Fundamentals, Unit 1 Lightning AI
13
x2 = − x1 × w1 − b
w2
Sebastian Raschka Deep Learning Fundamentals, Unit 1 Lightning AI
14
x2 = − x1 × w1 − b
w2
Sebastian Raschka Deep Learning Fundamentals, Unit 1 Lightning AI
x2 = − 0.0 × w1 − b
w2
Sebastian Raschka Deep Learning Fundamentals, Unit 1 Lightning AI
x2 = − 0.0 × 3.88 − 1.0
0.65
Sebastian Raschka Deep Learning Fundamentals, Unit 1 Lightning AI
−1.54 = − 0.0 × 3.88 − 1.0
0.65
Sebastian Raschka Deep Learning Fundamentals, Unit 1 Lightning AI
−1.54 = − 0.0 × 3.88 − 1.0
0.65
Sebastian Raschka Deep Learning Fundamentals, Unit 1 Lightning AI
x2 = − x1 × w1 − b
w2
Sebastian Raschka Deep Learning Fundamentals, Unit 1 Lightning AI
x2 = − x1 × w1 − b
w2
Sebastian Raschka Deep Learning Fundamentals, Unit 1 Lightning AI
Let’s set up a computing environment
and implement the perceptron model in code!
Sebastian Raschka Deep Learning Fundamentals, Unit 1 Lightning AI