Share Right
truth holds the real labels and guess what a model predicted. Return the accuracy: the share of predictions that are right.
Example 1
truth [1,0,1,1]
guess [1,0,0,1]
returns 0.75
Three of the four predictions match.
Constraints
1 <= len(truth) == len(guess) <= 60- Labels are whole numbers from 0 to 3
Write it in your browser, against the clock. The model solution, stepped through line by line, comes after.
More scikit-learn problems
- Typical Squared MissBeginner
- What the Model LearnedBeginner
- Zero to OneBeginner
- Curves From LinesEasy
- Fill the HolesEasy
- Found and FlaggedEasy
- One Column per NameEasy
- Score on Unseen RowsEasy