as we just discussedchanging the threshold that is used to make classification decision in model is way to adjust the trade-off of precision and recall for given classifier maybe you want to miss less than of positive samplesmeaning desired recall of this decision depends on the applicationand it should be driven by business goals once particular goal is set--saya particular recall or precision value for class-- threshold can be set appropriately it is always possible to set threshold to fulfill particular targetlike recall the hard part is to develop model that still has reasonable precision with this threshold--if you classify everything as positiveyou will have recallbut your model will be useless setting requirement on classifier like recall is often called setting the operating point fixing an operating point is often helpful in business settings to make performance guarantees to customers or other groups inside your organization oftenwhen developing new modelit is not entirely clear what the operating point will be for this reasonand to understand modeling problem betterit is instructive to look at all possible thresholdsor all possible trade-offs of precision and recalls at once this is possible using tool called the precision-recall curve you can find the function to compute the precision-recall curve in the sklearn metrics module it needs the ground truth labeling and predicted uncertaintiescreated via either decision_function or predict_probain[ ]from sklearn metrics import precision_recall_curve precisionrecallthresholds precision_recall_curvey_testsvc decision_function(x_test)the precision_recall_curve function returns list of precision and recall values for all possible thresholds (all values that appear in the decision functionin sorted orderso we can plot curveas seen in figure - in[ ]use more data points for smoother curve xy make_blobs(n_samples=( )centers= cluster_std=[ ]random_state= x_trainx_testy_trainy_test train_test_split(xyrandom_state= svc svc(gamma fit(x_trainy_trainprecisionrecallthresholds precision_recall_curvey_testsvc decision_function(x_test)find threshold closest to zero close_zero np argmin(np abs(thresholds)plt plot(precision[close_zero]recall[close_zero]' 'markersize= label="threshold zero"fillstyle="none" =' 'mew= plt plot(precisionrecalllabel="precision recall curve"plt xlabel("precision"plt ylabel("recall"evaluation metrics and scoring