Description Usage Arguments Details Value Examples
Given a receiver operating characteristic (ROC) curve, calculates the cost function with given weights on false positives and false negatives respectively.
1 | cost(fpr, tpr, fp.weight = 1)
|
fpr |
A numeric vector, representing the false positive rate (FPR) of points on a ROC curve. |
tpr |
A numeric vector, representing the true positive rate (TPR) of
points on a ROC curve, assumed to be corresponding to those represented
in |
fp.weight |
A weight (numeric value) representing the relative importance (cost) of a false positive, relative to a false negative. So a value of 2 would indicate a false positive is twice as ‘bad’ as a false negative, a value of 0.5 would indicate it is half as bad. |
Arguments fpr
and tpr
must contain only values between
0 and 1, without any NA or NaN values, and must be the same length.
Otherwise, cost
will throw an appropriate error.
A vector of costs.
1 2 3 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.