Skip to content

Week 3 Lecture 2

Linear Classification

π‘Ž,π‘βˆˆβ„π‘›

π‘Žπ‘‡π‘=βˆ‘π‘–=1𝑛[π‘Ž]𝑖[𝑏]𝑖

βŸ¨π‘Ž,π‘βŸ©=β€–π‘Žβ€–β€–π‘β€–cos∠(π‘Ž,𝑏)

(Affine) linear function

𝑓(𝑧)=𝑀𝑇𝑧+𝑏

Note that the Solid contour line (where 𝑓(𝑧)=0) is linear as well.

𝑓(π‘₯)=βŸ¨π‘€,π‘₯⟩

π‘₯βŠ₯ is the orthogonal projection of π‘₯ to the contour line (plane or stg on higher dimensions)

Distance from the plane:

|𝑓(π‘₯)|‖𝑀‖=|𝑀𝑇π‘₯+𝑏|‖𝑀‖
Note: signed distance
Decision functions

Typical classification between at least two label classes.

One approach is the β€˜discriminant functions’

We’ll have ∼ as usual

We have a fun modified sgn function:

sgn(𝛿(π‘₯))={1if𝛿(π‘₯)>0βˆ’1otherwise

𝑃(π‘Œ=π’žοΈ€π‘˜|𝑋=π‘₯)=𝑝(𝑋=π‘₯|π‘Œ=π’žοΈ€π‘˜)𝑃(π‘Œ=π’žοΈ€π‘˜)𝑝(𝑋=π‘₯)

Division by zero is only possible if the event is immesurable.

𝑃 vs 𝑝:

Input space (𝑋) can be continous, while the label space (π‘Œ) is discrete
𝑝 is a probability distribution
Joint probailities

see the slides

left of the line is one class, other is to the left

The coloured areas are point of possible error

Sweet spot is their intersection

By moving the line up until the sweet spot, we can see that the error decreases. (Red area is gone)

Logistic regression

Logistic function ∼ Fermi function ∼ standard sigmoid

πœƒ(𝑠)11+π‘’βˆ’π‘ 

Goal is (for two-point distribution):

𝑓(π‘₯)=𝑃(π‘Œ=1|𝑋=π‘₯)

𝑃(π‘Œ=𝑦|𝑋=π‘₯)={𝑓(π‘₯)for𝑦=11βˆ’π‘“(π‘₯)for𝑦=βˆ’1

For labels {0,1}, we have Bernouli.

𝑃(π‘Œ=𝑦|𝑋=π‘₯;𝑀)=πœƒ(𝑦𝑀𝑇π‘₯)
..because the sigmoid does the casing for π‘¦βˆˆ{βˆ’1,1}

Example for diverging algorithm for finding a classification function with ever higher confidence:

Logistinc regression

  • For every step, you calculate a sum of all datapoints.
  • Mini-batch only takes a random subset (introducing some noise/uncertainty); one can take smaller steps to compensate that.
  • Also, you can do the stochastic descent so you only take random points, und update the parameter until you meet the criteria.

Polinomial embedding:

You transform the data, so you can fit a function that separate the data points. (See the slides)

The slide first shows a higher dimensional representation so we can see the points being separate by adding an extra parameter (using )

Later this parameter can be the transformation on the input so we arrive in the original dimensions.

Perceptron Learning and Margins

Larger distance to the decision boundary (margin) can withstand a bigger noise. (making it more robust). Margin should be measured in relation to the input data. (β€˜cos changing the scale may show a β€˜bigger’ margin with the same performance)

The algorithm checks for misclassification (margin is negative :o).

Intuitively, if the point is misclassified, we add the vector to the boundary’s normal, and if we repeat this method, we’ll converge to a boundary where no errors are present. (Again, given that the two groups are separable)

This algorithm should terminate in (π‘…πœŒ)2 steps.

where

𝑅←max1≀𝑖≀𝑁‖π‘₯β€–

And we assume there is a 𝑀opt that

𝑦𝑖𝑀opt𝑇π‘₯𝑖β‰₯𝜌>0

Proof:

He jsut drops the cos parf of the vector product, so the inequality holds (in one of the steps).

Summary

  • Great method, β€˜cos it does not tend to overfitting.
  • Very linear, may need non-linear transformation to compensate
  • Good for β€˜Big Data’