Evaluate a machine learning model

A model flags eight items. Six are relevant, and there are ten relevant items altogether. Calculate precision and recall.

Examples

Example 1

Input
6 true positives, 2 false positives, 4 false negatives
Expected output
Precision 75%, recall 60%

Hints and solution

Hint 1

Both numerators are the six correctly flagged items. Use different totals as denominators.

Reveal worked answer

Precision is 6 divided by 8, which is 75%. Recall is 6 divided by 10, which is 60%.

Back to the lesson