the false positive rate (fpragainst the true positive rate (tprrecall that the true positive rate is simply another name for recallwhile the false positive rate is the fraction of false positives out of all negative samplesfpr fp fp+tn the roc curve can be computed using the roc_curve function (see figure - )in[ ]from sklearn metrics import roc_curve fprtprthresholds roc_curve(y_testsvc decision_function(x_test)plt plot(fprtprlabel="roc curve"plt xlabel("fpr"plt ylabel("tpr (recall)"find threshold closest to zero close_zero np argmin(np abs(thresholds)plt plot(fpr[close_zero]tpr[close_zero]' 'markersize= label="threshold zero"fillstyle="none" =' 'mew= plt legend(loc= figure - roc curve for svm for the roc curvethe ideal curve is close to the top leftyou want classifier that produces high recall while keeping low false positive rate compared to the default threshold of the curve shows that we can achieve significantly higher recall (around while only increasing the fpr slightly the point closest to the top left might be better operating point than the one chosen by default againbe aware that choosing threshold should not be done on the test setbut on separate validation set evaluation metrics and scoring