Assignment 7 information

Announcements

Support code & data sets

Generate your own synthetic data

Using the routines in the file generate-data.scm you can produce your own synthetic data which is guaranteed to be linearly separable. Here's how you use it:

(define h (pick-hyperplane 2))

h
;Value: ((-.8925898031763745 -.45086965218958913) .15687006660372727)
; the format of the hyperplane is (normal offset) so that:
;
; output = 1 if  the dot product of the "normal" and the "input" is
;            greater than the "offset"
;         -1 otherwise

(define d (lsdata h 10))
Of 10 examples, 5 are positive examples.

d
;Value: ((-1 (.8667412929548199 .17378869975659605))
         (-1 (-.09185614144878473 -.1411371356122395))
	 (1 (-.14720896904730352 -.44910735200288165))
	 (1 (-.24302071105109146 .12993139718884072))
	 (1 (-.7104105489682528 .9972802749803293))
	 (1 (-.698340137603623 .8554353330464048))
	 (1 (-.23009130827860358 -8.647936173537651e-3))
	 (-1 (.5941178449361095 .7622703851227071))
	 (-1 (.15212484490140898 .4744542207038662))
	 (-1 (.17650231762847657 .12650541626674294)))

(test-perceptron (cons (second h) (first h)) d)
;Value: 1.
; i.e. it classified 100% of the examples in d correctly