c02 · E1

Practise: Learning a Rule From Examples

c02.E1.1E1 · numeric

A table holds nine rows and four features. Row 3 has no recorded label. Row 7 holds the word dark where a number belongs in one feature cell. The query row carries three of the four features. Every other stored row is complete and numeric. How many usable stored rows remain?

c02.E1.2E1 · numeric

Two rows are stored: with label 0 and with label 1. A query arrives at . Compute the Euclidean distance from the query to the nearer stored row, to three decimal places.

c02.E1.3E1 · numeric

Rule A is wrong on 7 of 250 rows. Rule B is wrong on 9 of 360 rows. By how much does the worse error rate exceed the better one, as a fraction of one?

c02.E1.4E1 · numeric

A rule predicts 3, 5 and 7 on three rows whose true answers are 4, 5 and 10. Charge the squared difference between the prediction and the true answer on each row. What is the average charge over the three rows, to three decimal places?

c02.E1.5E1 · numeric

Four rows are stored with one feature: , , and . Run the one-neighbour rule on these same four rows and score it with the zero-one loss. When two stored rows sit at the same distance, the row with the smaller index wins. Give the training error rate.

c02.E1.6E1 · numeric

A training set holds , , , and . A test set holds , and . Run the one-neighbour rule and break distance ties by the smaller index. First score the rule on the test set as it stands. Then copy the test row into the training set and score the rule on the same three test rows again. Give the reported test error rate after the copy.

c02.E1.7E1 · expression

Five stored rows sit at distances 1, 2, 3, 4 and 5 from a query. Their labels, in that order, are 1, 0, 0, 1, 1. Give the prediction of the -nearest-neighbour rule at , at and at . When two labels tie in the vote, the smaller label wins.

This tier asks for a derivation, so there is no automatic checker. Write your answer, then open the worked solution and compare.

c02.E1.8E1 · numeric

A training set holds , , , and . A test set holds , and . The candidate rule answers 1 when the feature is above 3 and 0 otherwise. Give its test error rate.

Other tiers

E2 Derive · E3 Open

Every hint opened, solution viewed and answer checked is recorded in this browser only. See Progress to export or delete it.