Precision and Recall
Start Timer
0:00:00
Given a 2-D matrix P of predicted values and actual values, write a function precision_recall to calculate precision and recall metrics.
Return the ordered pair (precision, recall).
Example:
Input:
P = [[121, 9],
[17, 144]]
where P represents the following table
Predicted =TRUE | Predicted =FALSE | |
---|---|---|
Actual =TRUE | 121 | 9 |
Actual =FALSE | 17 | 144 |
Output:
def precision_recall(P) -> (0.931, 0.877,)
Recommended questions for you
Personalized based on your user activity, skill level, and preferences.
.
.
.
.
.
.
.
.
.
Comments