receiver operating characteristic curve roc which stands for receiver operating characteristic is concept from early radar days this concept can be extended to evaluation of binary classifiers as well as multi-class classifiers (note that to adapt the roc curve for multi-class classifiers we have to use one-vs-all scheme and averaging techniques like macro and micro averaging it can be interpreted as the effectiveness with which the model can distinguish between actual signal and the noise in the data the roc curve can be created by plotting the fraction of true positives versus the fraction of false positivesi it is plot of true positive rate (tprversus the false positive rate (fprit is applicable mostly for scoring classifiers scoring classifiers are the type of classifiers which will return probability value or score for each class labelfrom which class label can be deduced (based on maximum probability valuethis curve can be plotted using the true positive rate (tprand the false positive rate (fprof classifier tpr is known as sensitivity or recallwhich is the total number of correct positive resultspredicted among all the positive samples the dataset fpr is known as false alarms or ( specificity)determining the total number of incorrect positive predictions among all negative samples in the dataset although we will rarely be plotting the roc curve manuallyit is always good idea to understand how they can be plotted the following steps can be followed to plot roc curve given the class label probabilities of each data point and their correct or true labels order the outputs of the classifier by their scores (or the probability of being the positive class start at the ( coordinate for each example in the sorted order up pos right if is negativemove neg if is positivemove here pos and neg are the fraction of positive and negative examples respectively the idea is that typically in any roc curvethe roc space is between points ( and ( each prediction result from the confusion matrix occupies one point in this roc space ideallythe best prediction model would give point on the top left corner ( indicating perfect classification ( sensitivity specificitya diagonal line depicts classifier that does random guess ideally if your roc curve occurs in the top half of the graphyou have decent classifier which is better than average you can always leverage the roc_curve function provided by scikit-learn to generate the necessary data for an roc curve refer to org/stable/auto_examples/model_selection/plot_roc html for further details figure - shows sample roc curve from the link we just mentioned