Problem 1
- Test level
- Multiple choice
- No calculator
- 4 pts
A study records hours of sleep (the feature) and reaction time in milliseconds (the label) for three students:
rows = [[8, 250], [5, 310], [7, 270]]
flipped = [[y, x] for x, y in rows]
A model trained on flipped treats column 0 as its feature and column 1 as its label, just like any other table. What is flipped[1][1], and what role does it play in flipped?
Answer
5, hours of sleep, which is now the label
Full solution
flippedwrites each row with the two numbers swapped:[[250, 8], [310, 5], [270, 7]].flipped[1]is[310, 5], soflipped[1][1]is 5, the hours of sleep from the second student.In
flipped, column 1 is the label column, so the hours of sleep are now being treated as the label.
Where students lose points
Picking "310, reaction time, which is still the label" means you read rows[1][1] instead of flipped[1][1]. After the swap, column 1 holds the old feature, and column 1 is always the label.

