What is modeling? NEU 466M Instructor: Professor Ila R. - - PowerPoint PPT Presentation

what is modeling
SMART_READER_LITE
LIVE PREVIEW

What is modeling? NEU 466M Instructor: Professor Ila R. - - PowerPoint PPT Presentation

What is modeling? NEU 466M Instructor: Professor Ila R. Fiete Spring 2016 Reference: NEURAL NETWORKS FOR PATTERN RECOGNITION, CHRISOPHER BISHOP


slide-1
SLIDE 1

What ¡is ¡modeling? ¡ ¡

NEU ¡466M ¡ Instructor: ¡Professor ¡Ila ¡R. ¡Fiete ¡ Spring ¡2016 ¡

slide-2
SLIDE 2

NEURAL ¡NETWORKS ¡FOR ¡PATTERN ¡ RECOGNITION, ¡CHRISOPHER ¡BISHOP ¡

Reference: ¡

hEp://cs.du.edu/~mitchell/mario_books/Neural_Networks_for_PaEern_RecogniLon_-­‑_Christopher_Bishop.pdf ¡

slide-3
SLIDE 3

What ¡does ¡modeling ¡mean? ¡

example of ‘a’ example of ‘b’ Pixels xi with values 1 or 0 (black or white).

slide-4
SLIDE 4

What ¡does ¡modeling ¡mean? ¡

example of ‘a’ example of ‘b’ What is ‘a’-ness, versus ‘b’-ness?

slide-5
SLIDE 5

Equivalent ¡problem ¡encountered ¡by ¡electrophysiologists ¡

Categorize ¡recorded ¡spike ¡as ¡coming ¡from ¡neuron ¡a ¡or ¡b ¡

→ ‘a’ ‘b’

figure ¡from ¡Quian ¡Quiroga ¡

slide-6
SLIDE 6

What ¡does ¡modeling ¡mean? ¡

example of ‘a’ example of ‘b’ What is ‘a’-ness, versus ‘b’-ness?

slide-7
SLIDE 7

Model: ¡relaLonship ¡between ¡data ¡and ¡ its ¡category ¡

256 × 256 pixels : N = 65536

Store every image with its letter label?

{x1, x2, · · · , xN} → ‘a’ {x0

1, x0 2, · · · , x0 N} → ‘b’

slide-8
SLIDE 8

Model: ¡store ¡every ¡possible ¡image ¡ with ¡corresponding ¡leEer ¡label? ¡

256 × 256 pixels : N = 65536

→ ‘a’ ‘b’

Number of 256 × 256 bw images: 265536 ∼ 1020000

Atoms in universe: ∼ 1080 Houston, ¡we ¡have ¡a ¡problem. ¡ ¡

slide-9
SLIDE 9

Storing ¡each ¡data, ¡category ¡pair ¡

  • Need ¡too ¡many ¡examples/data ¡to ¡fill ¡grid ¡between ¡

inputs ¡to ¡categories! ¡“Curse ¡of ¡dimensionality” ¡

  • Too ¡much ¡data ¡to ¡store! ¡ ¡

à ¡Compactness ¡ ¡

  • Not ¡predicLve: ¡What ¡to ¡do ¡with ¡new ¡example? ¡ ¡

¡ à ¡Generalizability ¡ ¡

slide-10
SLIDE 10

What ¡we ¡want ¡from ¡a ¡model: ¡compactness ¡and ¡

  • generalizability. ¡
slide-11
SLIDE 11

One ¡soluLon: ¡feature ¡selecLon ¡

  • Look ¡at ¡some ¡much ¡smaller ¡set ¡of ¡

characterisLc ¡features ¡that ¡define ¡the ¡classes. ¡

  • How ¡to ¡choose ¡these? ¡ ¡

¡-­‑ ¡by ¡“hand” ¡ ¡-­‑ ¡some ¡“automaLc” ¡technique ¡

(sounds ¡magical ¡but ¡this ¡is ¡goal ¡of ¡much ¡staLsLcs ¡and ¡machine ¡learning; ¡ ¡ we ¡will ¡consider ¡how ¡automaLcally ¡find ¡features ¡in ¡this ¡class) ¡

slide-12
SLIDE 12

Features ¡

˜ x1 : height-to-width ratio of object ˜ x2 : some other feature

slide-13
SLIDE 13

Features ¡

˜ x1 : height-to-width ratio of object ˜ x2 : some other feature

: ‘a’ × : ‘b’

slide-14
SLIDE 14

Features ¡

: ‘a’ × : ‘b’

˜ x1 only would lead to poor categorization More features can be helpful:

slide-15
SLIDE 15

Features ¡

  • If ¡adding ¡features ¡improves ¡performance, ¡

keep ¡adding ¡independent ¡features? ¡

  • Will ¡this ¡conLnue ¡to ¡improve ¡performance? ¡

At ¡some ¡point, ¡NO! ¡Performance ¡will ¡get ¡worse. ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡WHY? ¡

slide-16
SLIDE 16

A ¡more ¡familiar ¡example: ¡regression ¡

  • Instead ¡of ¡discrete ¡categories ¡(‘a’, ¡’b’), ¡each ¡

datapoint ¡(or ¡data ¡vector) ¡maps ¡to ¡some ¡value ¡

  • f ¡a ¡conLnuous ¡variable ¡(y). ¡ ¡

¡

{(x1, y1), (x2, y2), · · · , (xN, yN)}

slide-17
SLIDE 17

{(x1, y1), (x2, y2), · · · , (xN, yN)} x1 independent variable y1 response or dependent variable

slide-18
SLIDE 18

Modeling ¡as ¡regression ¡

{(x1, y1), (x2, y2), · · · , (xN, yN)}

What ¡does ¡it ¡mean ¡to ¡model ¡this ¡data? ¡ ¡

  • ­‑ ¡ ¡Want ¡to ¡write ¡y ¡as ¡some ¡funcLon ¡of ¡x ¡
  • ­‑ Want ¡to ¡fit ¡a ¡funcLon ¡through ¡x, ¡y ¡ ¡
  • ­‑ Given ¡x ¡want ¡to ¡predict ¡y ¡
slide-19
SLIDE 19

Regression: ¡curve-­‑fieng ¡

{(x1, y1), (x2, y2), · · · , (xN, yN)} free parameters: (w0, w1, · · · , wM) ˜ y(x) = w0 + w1x + · · · + wMxM =

M

X

j=0

wjxj

slide-20
SLIDE 20

Polynomial ¡regression ¡

  • The ¡larger ¡M, ¡the ¡higher-­‑degree ¡the ¡polynomial ¡

à ¡more ¡complex ¡model/more ¡features. ¡ ¡

  • Expect ¡fit ¡to ¡get ¡beEer ¡with ¡increasing ¡M. ¡ ¡

When ¡M ¡= ¡N, ¡then ¡exact ¡fit ¡to ¡all ¡datapoints ¡(b/c ¡ Mth ¡order ¡polynomial ¡has ¡M+1 ¡parameters, ¡M ¡ roots). ¡ ¡

  • So ¡are ¡the ¡more-­‑complex ¡models ¡beEer? ¡ ¡
slide-21
SLIDE 21

Parameters ¡chosen ¡to ¡minimize ¡fit ¡error ¡

Common ¡error ¡funcLon: ¡sum-­‑of-­‑squares: ¡ ¡

(How ¡to ¡implement? ¡Matlab: ¡polyfit. ¡Theory: ¡we’ll ¡get ¡to ¡it.) ¡ (Is ¡this ¡the ¡only ¡choice? ¡No. ¡Best ¡choice? ¡InteresLng ¡q: ¡we’ll ¡get ¡to ¡it.) ¡

w∗ = arg min

w

1 2

N

X

n=1

[˜ y(xn; w) − yn] E = 1 2

N

X

n=1

[˜ y(xn; w) − yn]

slide-22
SLIDE 22

0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 Degree 1, squared error = 0.45126

Linear ¡fit ¡(M=1) ¡

N ¡= ¡11 ¡datapoints ¡ dashed ¡= ¡true ¡fxn ¡

x y

slide-23
SLIDE 23

0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 Degree 2, squared error = 0.45126

QuadraLc ¡(M=2) ¡

N ¡= ¡11 ¡datapoints ¡ dashed ¡= ¡true ¡fxn ¡

x y

slide-24
SLIDE 24

0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 Degree 3, squared error = 0.02289

Cubic ¡

N ¡= ¡11 ¡datapoints ¡ dashed ¡= ¡true ¡fxn ¡

x y

slide-25
SLIDE 25

0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 Degree 9, squared error = 0.0023272

M=9 ¡

N ¡= ¡11 ¡datapoints ¡ dashed ¡= ¡true ¡fxn ¡

x y

slide-26
SLIDE 26

0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 −0.4 −0.2 0.2 0.4 0.6 0.8 1 Degree 11, squared error = 1.184e−20

M ¡= ¡11 ¡

N ¡= ¡11 ¡datapoints ¡ dashed ¡= ¡true ¡fxn ¡

x y

slide-27
SLIDE 27

1 2 3 4 5 6 7 8 9 10 11 0.05 0.1 0.15 0.2 0.25 0.3 0.35 0.4 0.45 0.5

Sum-­‑of-­‑squares ¡error ¡

fit ¡error ¡on ¡training/new ¡data ¡

M squared error

slide-28
SLIDE 28

Predictability ¡

  • Error ¡on ¡fieng ¡the ¡specific ¡training ¡data ¡keeps ¡decreasing ¡with ¡

model ¡complexity ¡(M). ¡

  • Error ¡of ¡fit ¡to ¡previously ¡un-­‑fit/unseen ¡data ¡improves ¡but ¡then ¡

worsens ¡with ¡increasing ¡M. ¡

  • Model ¡is ¡overfi.ng ¡to ¡foibles ¡of ¡training ¡data ¡(noise) ¡ajer ¡M ¡= ¡3. ¡ ¡
  • Model ¡becomes ¡both ¡more ¡complex ¡and ¡less ¡predic8ve ¡beyond ¡M ¡= ¡

3 ¡features. ¡ ¡

  • Key ¡technique: ¡cross-­‑validaLon. ¡Test ¡model ¡on ¡previously ¡unseen ¡
  • data. ¡Hold-­‑out ¡dataset ¡or ¡jack-­‑knife/leave-­‑one-­‑out ¡approaches. ¡ ¡

(There ¡are ¡other ¡ways ¡to ¡improve ¡predictability ¡by ¡reducing ¡complexity, ¡ ¡ e.g. ¡by ¡directly ¡constraining ¡the ¡complexity ¡of ¡the ¡model: ¡“regularizaLon”) ¡ ¡

slide-29
SLIDE 29

Back ¡to ¡categorizaLon ¡example ¡

simplest ¡ intermediate ¡ most ¡flexible/complex ¡ exhibits ¡overfieng ¡

slide-30
SLIDE 30

BeEer ¡features: ¡admit ¡simpler ¡model ¡

poor ¡choice ¡of ¡features ¡

→ ‘a’ ‘b’

beEer ¡choice ¡of ¡features ¡

(In ¡regression ¡example, ¡data ¡were ¡generated ¡from ¡a ¡sine ¡wave. ¡ ¡ Using ¡sines ¡instead ¡of ¡polynomials ¡would ¡have ¡produced ¡an ¡excellent ¡2-­‑parameter ¡fit.) ¡

slide-31
SLIDE 31

Summary ¡

  • A ¡good ¡model ¡can ¡describe ¡the ¡data ¡in ¡a ¡

relaLvely ¡simple/low-­‑complexity/compact ¡way ¡ (but ¡not ¡too ¡low! ¡Einstein: ¡as ¡simple ¡as ¡possible, ¡ but ¡no ¡simpler) ¡and ¡has ¡good ¡predicLon ¡

  • performance. ¡ ¡ ¡
  • ExtracLng ¡“features” ¡of ¡data ¡as ¡a ¡way ¡to ¡model ¡it. ¡ ¡
  • To ¡determine ¡predictability, ¡important ¡to ¡cross-­‑

validate ¡models/fits. ¡ ¡