roc curve -凯发k8网页登录

evaluate the performance of machine learning classification models

roc curves (receiver operating characteristic curves) are an important tool for evaluating the performance of a machine learning model. they are most commonly used for binary classification problems – those that have two distinct output classes. the roc curve shows the relationship between the true positive rate (tpr) for the model and the false positive rate (fpr). the tpr is the rate at which the classifier predicts “positive” for observations that are “positive.” the fpr is the rate at which the classifier predicts “positive” for observations that are actually “negative.” a perfect classifier will have a tpr of 1 and an fpr of 0.

you can calculate roc curves in matlab® using the perfcurve function from statistics and machine learning toolbox™. additionally, the classification learner app generates roc curves to help you assess model performance. the app lets you specify different classes to plot, so you can view roc curves for multiclass classification problems that have more than two distinct output classes.

video length is 4:43.

how roc curves work

most machine learning models for binary classification do not output just 1 or 0 when they make a prediction. instead, they output a continuous value somewhere in the range [0,1]. values at or above a certain threshold (for example 0.5) are then classified as 1 and values below that threshold are classified as 0. the points on the roc curve represent the fpr and tpr for different threshold values.

the selected threshold can be anywhere on the range [0,1], and the resulting classifications will change based on the value of this threshold. for example, if the threshold is set all the way to 0, the model will always predict 1 (anything at or above 0 is classified as 1) resulting in a tpr of 1 and an fpr of 1. at the other end of the roc curve, if the threshold is set to 1, the model will always predict 0 (anything below 1 is classified as 0) resulting in a tpr of 0 and an fpr of 0.

when evaluating the performance of a classification model, you are most interested in what happens in between these extreme cases. in general, the more “up and to the left” the roc curve is, the better the classifier.

roc curves are typically used with cross-validation to assess the performance of the model on validation or test data .

roc curves calculated with the perfcurve function for (from left to right) a perfect classifier, a typical classifier, and a classifier that does no better than a random guess.


examples and how to

  • - example
  • - example

software reference

see also: cross-validation, machine learning

网站地图