Since this test checks the values of the weights that you return, it is important that you go through the training data in order and use the perceptron learning rule exactly as it is given, updating the weights after each example. Also important, if course, is prepending a -1 to be the first element of the actual "input vector".
The perceptron you learn is tested first against the training data and then against an independent test data set. Since there are eight parts to this test (two different data sets, two tests for each, and two measurements for each test), each part is worth 4 points which are awarded according to the percentage of examples that your perceptron classifies correctly:
> 0.95 = 4 points > 0.85 = 3 points > 0.70 = 2 points > 0.50 = 1 points <= 0.50 = 0 points(Hence you can actually get 32 points for this problem instead of the 30 advertised.)
(test-perceptron (learn-perceptron set-one-A set-one-B) set-one-A) (test-perceptron (learn-perceptron set-one-A set-one-B) set-one-D) (test-perceptron (learn-perceptron set-one-C set-one-D) set-one-C) (test-perceptron (learn-perceptron set-one-C set-one-D) set-one-B) (test-perceptron (learn-perceptron set-two-A set-two-B) set-two-A) (test-perceptron (learn-perceptron set-two-A set-two-B) set-two-D) (test-perceptron (learn-perceptron set-two-C set-two-D) set-two-C) (test-perceptron (learn-perceptron set-two-C set-two-D) set-two-B)
The first data set has 2 inputs; the second has 10 inputs.