Algorithm · Microsoft · Medium
Consider a binary classification model that has produced predictions for n samples. You are given two arrays: y_true: length n, where each value is either 0 or 1. y_score: length n, where each value is a predicted score in [0, 1]. Write a function precision_recall_curve(y_true, y_score) that returns the precision–recall curve for these predictions. Sort all samples by y_score in decreasing order. Sweep the decision threshold from above the largest score down through each…
Checking your access…