Typical Squared Miss
truth holds real values and guess what a model predicted. Return the mean squared error: the average of the squared differences.
Example 1
truth [3,5,7]
guess [2,5,9]
returns 1.6666666666666667
The misses are 1, 0 and 2. Their squares, 1, 0 and 4, average to 1.67.
Constraints
1 <= len(truth) == len(guess) <= 60
Write it in your browser, against the clock. The model solution, stepped through line by line, comes after.
More scikit-learn problems
- What the Model LearnedBeginner
- Zero to OneBeginner
- Curves From LinesEasy
- Fill the HolesEasy
- Found and FlaggedEasy
- One Column per NameEasy
- Score on Unseen RowsEasy
- Small TreeEasy