Implement four classifier summaries from Murphy's book.
f_beta(tp, fp, fn, beta=1.0): .equal_error_rate(y, scores): y holds 0/1 labels (both present) and scores real scores where higher means more positive. Build the ROC curve from the thresholds = every distinct score in decreasing order, predicting positive when score >= t, and put the point in front. Walk along the points and find the first one where . If there, return its FPR. Otherwise interpolate linearly between it and the previous point to the place where , and return the FPR there (where FPR equals FNR).precision_at_prevalence(tpr, fpr, r): the precision of an operating point with the given TPR and FPR when the ratio of positives to negatives is .f_beta_at_prevalence(tpr, fpr, r, beta=1.0): of the same operating point at ratio .Return floats.