Docsity

CS260: Machine Learning Algorithms Lecture 6, Lecture notes of Machine Learning

Partial preview of the text

Download CS260: Machine Learning Algorithms Lecture 6 and more Lecture notes Machine Learning in PDF only on Docsity!

CS260: Machine Learning Algorithms

Lecture 6: Nonlinear mapping, Model complexity

Cho-Jui Hsieh UCLA

Jan 28, 2019

Nonlinear Transformation

Circular Separable

Data is not linear separable

Circular Separable

Data is not linear separable but circular separable by a circle of radius √ 0 .6 centered at origin: hSEP(x) = sign(−x 12 − x 22 + 0.6)

Circular Separable and Linear Separable

h(x) = sign( 0︸︷︷︸. 6 w ˜ 0

z 0

w ˜ 1

· (^) ︸︷︷︸x 12 z 1

w ˜ 2

· (^) ︸︷︷︸x 22 z 2

= sign( ˜w T^ z)

Circular Separable and Linear Separable

h(x) = sign( 0︸︷︷︸. 6 w ˜ 0

z 0

w ˜ 1

· (^) ︸︷︷︸x 12 z 1

w ˜ 2

· (^) ︸︷︷︸x 22 z 2

= sign( ˜w T^ z)

{(xn, yn)} circular separable ⇒ {(zn, yn)} linear separable

Nonlinear Transformation

Define nonlinear transformation Φ(x) = (1, x 12 , x 22 ) = (z 0 , z 1 , z 2 ) = z

Nonlinear Transformation

Define nonlinear transformation Φ(x) = (1, x 12 , x 22 ) = (z 0 , z 1 , z 2 ) = z

Linear hypotheses in Z space: sign(˜h(z)) = sign(˜h(Φ(x))) = sign(w T^ Φ(x))

General Quadratic Hypothesis Set

A “bigger” Z-space: Φ 2 (x) = (1, x 1 , x 2 , x 12 , x 1 x 2 , x 22 )

General Quadratic Hypothesis Set

A “bigger” Z-space: Φ 2 (x) = (1, x 1 , x 2 , x 12 , x 1 x 2 , x 22 )

Linear in Z-space ⇔ quadratic hypotheses in X -space

General Quadratic Hypothesis Set

A “bigger” Z-space: Φ 2 (x) = (1, x 1 , x 2 , x 12 , x 1 x 2 , x 22 )

Linear in Z-space ⇔ quadratic hypotheses in X -space The hypotheses space: HΦ 2 = {h(x) : h(x) = ˜w T^ Φ 2 (x) for some ˜w } (Quadratic hypotheses) Also include linear model as a degenerate case

Learning a good quadratic function

Transform original data {xn, yn} to {zn = Φ(xn), yn} Solve a linear problem on {zn, yn} using your favorite algorithm A to get a good model ˜w Return the model h(x) = sign( ˜w T^ Φ(x))

Polynomial mappings

Can now freely do quadratic classification, quadratic regression, · · · Can easily extend to any degree of polynomial mappings E.g., Φ(x) = (x 1 , x 2 , x 3 , x 1 x 2 , x 1 x 3 , x 2 x 3 , x 1 x 22 , x 1 x 32 , x 1 x 22 , x 22 x 3 , x 12 x 3 , x 22 x 3 , x 13 , x 23 , x 33 )

The price we pay: Computational complexity

Q-th order polynomial transform: Φ(x) = (1, x 1 , x 2 , · · · , xd , x 12 , x 1 x 2 , · · · , x d^2 , · · · x 1 Q , x 1 Q −^1 x 2 , · · · , xdQ ) O(dQ^ ) dimensional vector ⇒ High computational cost