Move the prediction closer to the target and compare the numbers.
target = 4
prediction = 7
print(abs(target - prediction)) Line notes
- Set the known target value.
- Set one prediction.
- Print the distance from the prediction to the target.
Question 4 of 5
Two versions choose the correct question type equally often, but one has lower loss. Explain the difference before choosing a model.
You predict five deliveries and eight arrive. Measuring the error as the distance between prediction and outcome gives three. A prediction of eleven also gives three. This measure fits a task where underestimating and overestimating by the same number of deliveries are equally undesirable.
WHERE TO START
Two predictions miss the target by different amounts. What do you want to measure?
Move the prediction closer to the target and compare the numbers.
target = 4
prediction = 7
print(abs(target - prediction))