calculating the precision and recall for a specific threshhold I have a logistic regression model in which I calculate the tpr, fpr and thresholds using the roc_curve. After looking at the accuracy rates for different thresholds, I found the most optimal threshold to be 0.63. I have been told that I need to calculate the new precision and recall based on the most optimal threshold which in this case is 0.63. Is there any way to this calculation is python?
y_pred = log_reg.predict_proba(X)[:, 1] &gt; 0.63
print(precision_score(y_true, y_pred), recall_score(y_true, y_pred))