Asset-V1 MITx+6.86x+3T2020+typeasset+blockslides Lecture2 Compressed
Asset-V1 MITx+6.86x+3T2020+typeasset+blockslides Lecture2 Compressed
Lecture 2
Review of basic concepts
‣ Feature vectors, labels
‣ Training set
‣ Classifier
‣ Training error
‣ Test error
‣ Set of classifiers
Review: training set
x2
- +
+
x1
-
Review: a classifier
x2
h(x) = +1
- +
+
h(x) = 1
x1
-
Review: test set
x2
? h(x) = +1
? ?
? +
- ?
+
?
h(x) = 1? ?
?
?
x1
? -
This lecture
‣ The set of linear classifiers
‣ Linear separation
‣ Perceptron algorithm
Linear classifiers
x2
x1
Linear classifiers through origin
x2
x1
Linear classifiers
x2
x1
Linear separation: ex
x2
x1
Linear separation: ex
x2
x1
Linear separation: ex
x2
x1
Linear separation
Definition:
Training examples Sn = {(x(i) , y (i) }), i = 1, . . . , n} are
linearly separable if there exists a parameter vector ✓ˆ and
o↵set parameter ✓ˆ0 such that y (i) (✓ˆ · x(i) + ✓ˆ0 ) > 0 for all
i = 1, ..., n.
Learning linear classifiers
‣ Training error for a linear classifier (through origin)
Learning linear classifiers
‣ Training error for a linear classifier
Learning algorithm: perceptron
Algorithm 1 Perceptron Algorithm (without offset)
procedure Perceptron({(x(i) , y (i) ), i = 1, . . . , n}, T )
✓ = 0 (vector)
for t = 1, . . . , T do
for i = 1, . . . , n do
if y (i) (✓ · x(i) ) 0 then
✓ = ✓ + y (i) x(i)
return ✓
x2
x1
The perceptron algorithm and the above statements about c
to the casePerceptron (with offset)
with the offset parameter.
6: ✓ = ✓ + y (i) x(i)
7: ✓0 = ✓0 + y (i)
8: return ✓, ✓0
‣ Linear separation
‣ Perceptron algorithm