LearnPy Hub
← Machine Learning: scikit-learn problems
Medium

Precision and Recall

Read true and predicted labels (1 = positive, 0 = negative). Print precision and recall for the positive class, each with 2 decimals, separated by a space. If the model never predicts 1, precision counts as 0.

Input

Two lines of 0s and 1s: true labels, then predictions.

Output

Two numbers with 2 decimals.

Sample 1

Input
0 0 1 1 0 1 0 0 1 0
0 0 1 0 0 1 1 0 1 0
Output
0.75 0.75

Sample 2

Input
1 1 1 0
1 1 1 1
Output
0.75 1.00
solution.py
Output appears here
Hints
Precision and Recall · Python practice problem · LearnPy Hub