Last data update: 2014.03.03

R: Compute the sensitivity curve.
sensitivityR Documentation

Compute the sensitivity curve.

Description

This function computes the sensitivity curve required for the auc function and the plot function.

Usage

  sensitivity(predictions, labels, perc.rank = TRUE)

Arguments

predictions

A numeric vector of classification probabilities (confidences, scores) of the positive event.

labels

A factor of observed class labels (responses) with the only allowed values {0,1}.

perc.rank

A logical. If TRUE (default) the percentile rank of the predictions is used.

Value

A list containing the following elements:

cutoffs

A numeric vector of threshold values

measure

A numeric vector of sensitivity values corresponding to the threshold values

Author(s)

Authors: Michel Ballings and Dirk Van den Poel, Maintainer: Michel.Ballings@UGent.be

References

Ballings, M., Van den Poel, D., Threshold Independent Performance Measures for Probabilistic Classifcation Algorithms, Forthcoming.

See Also

sensitivity, specificity, accuracy, roc, auc, plot

Examples

data(churn)

sensitivity(churn$predictions,churn$labels)

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(AUC)
AUC 0.3.0
Type AUCNews() to see the change log and ?AUC to get an overview.
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/AUC/sensitivity.Rd_%03d_medium.png", width=480, height=480)
> ### Name: sensitivity
> ### Title: Compute the sensitivity curve.
> ### Aliases: sensitivity
> 
> ### ** Examples
> 
> data(churn)
> 
> sensitivity(churn$predictions,churn$labels)
$cutoffs
  [1] 1.0000000000 0.9784946237 0.9777265745 0.9754224270 0.9746543779
  [6] 0.9731182796 0.9723502304 0.9715821813 0.9708141321 0.9700460829
 [11] 0.9692780338 0.9685099846 0.9669738863 0.9662058372 0.9654377880
 [16] 0.9646697389 0.9639016897 0.9631336406 0.9623655914 0.9615975422
 [21] 0.9608294931 0.9600614439 0.9546850998 0.9539170507 0.9531490015
 [26] 0.9523809524 0.9516129032 0.9508448541 0.9500768049 0.9493087558
 [31] 0.9485407066 0.9477726575 0.9470046083 0.9462365591 0.9454685100
 [36] 0.9447004608 0.9431643625 0.9423963134 0.9408602151 0.9393241167
 [41] 0.9385560676 0.9377880184 0.9370199693 0.9362519201 0.9354838710
 [46] 0.9347158218 0.9331797235 0.9324116743 0.9316436252 0.9308755760
 [51] 0.9293394777 0.9285714286 0.9262672811 0.9254992320 0.9247311828
 [56] 0.9239631336 0.9231950845 0.9224270353 0.9216589862 0.9208909370
 [61] 0.9193548387 0.9185867896 0.9178187404 0.9170506912 0.9124423963
 [66] 0.9093701997 0.9078341014 0.9070660522 0.9062980031 0.9039938556
 [71] 0.9032258065 0.9024577573 0.9016897081 0.9009216590 0.8993855607
 [76] 0.8978494624 0.8970814132 0.8947772657 0.8924731183 0.8917050691
 [81] 0.8909370200 0.8894009217 0.8886328725 0.8878648233 0.8870967742
 [86] 0.8863287250 0.8832565284 0.8817204301 0.8809523810 0.8801843318
 [91] 0.8794162826 0.8786482335 0.8771121352 0.8763440860 0.8748079877
 [96] 0.8709677419 0.8701996928 0.8686635945 0.8640552995 0.8617511521
[101] 0.8609831029 0.8602150538 0.8594470046 0.8586789555 0.8548387097
[106] 0.8540706605 0.8463901690 0.8448540707 0.8417818740 0.8410138249
[111] 0.8387096774 0.8364055300 0.8356374808 0.8325652842 0.8317972350
[116] 0.8310291859 0.8294930876 0.8248847926 0.8241167435 0.8233486943
[121] 0.8225806452 0.8218125960 0.8210445469 0.8195084485 0.8179723502
[126] 0.8172043011 0.8164362519 0.8149001536 0.8141321045 0.8125960061
[131] 0.8102918587 0.8087557604 0.8072196621 0.8064516129 0.8056835637
[136] 0.8026113671 0.8010752688 0.7995391705 0.7941628264 0.7926267281
[141] 0.7895545315 0.7872503840 0.7857142857 0.7849462366 0.7795698925
[146] 0.7772657450 0.7757296467 0.7741935484 0.7711213518 0.7688172043
[151] 0.7665130568 0.7657450077 0.7634408602 0.7619047619 0.7580645161
[156] 0.7542242704 0.7526881720 0.7488479263 0.7480798771 0.7457757296
[161] 0.7396313364 0.7365591398 0.7357910906 0.7350230415 0.7311827957
[166] 0.7281105991 0.7250384025 0.7227342550 0.7181259601 0.7150537634
[171] 0.7142857143 0.7104454685 0.7096774194 0.7058371736 0.6996927803
[176] 0.6989247312 0.6958525346 0.6897081413 0.6858678955 0.6827956989
[181] 0.6781874040 0.6751152074 0.6735791091 0.6697388633 0.6651305684
[186] 0.6582181260 0.6528417819 0.6490015361 0.6474654378 0.6436251920
[191] 0.6405529954 0.6351766513 0.6313364055 0.6274961598 0.6221198157
[196] 0.6167434716 0.6136712750 0.6067588326 0.6036866359 0.5998463902
[201] 0.5952380952 0.5921658986 0.5867895545 0.5829493088 0.5775729647
[206] 0.5675883257 0.5576036866 0.5483870968 0.5391705069 0.5261136713
[211] 0.5222734255 0.5161290323 0.5038402458 0.4946236559 0.4823348694
[216] 0.4600614439 0.4301075269 0.3986175115 0.3440860215 0.0007680492
[221] 0.0000000000

$measure
  [1] 0.0000000 0.1635220 0.1635220 0.1823899 0.1886792 0.2012579 0.2012579
  [8] 0.2075472 0.2075472 0.2138365 0.2201258 0.2201258 0.2264151 0.2327044
 [15] 0.2327044 0.2389937 0.2452830 0.2515723 0.2515723 0.2578616 0.2641509
 [22] 0.2704403 0.3018868 0.3018868 0.3018868 0.3018868 0.3081761 0.3144654
 [29] 0.3207547 0.3207547 0.3207547 0.3207547 0.3270440 0.3270440 0.3333333
 [36] 0.3333333 0.3333333 0.3333333 0.3333333 0.3333333 0.3333333 0.3396226
 [43] 0.3459119 0.3522013 0.3584906 0.3584906 0.3647799 0.3647799 0.3647799
 [50] 0.3647799 0.3710692 0.3773585 0.3836478 0.3836478 0.3836478 0.3836478
 [57] 0.3836478 0.3899371 0.3962264 0.4025157 0.4150943 0.4150943 0.4213836
 [64] 0.4213836 0.4213836 0.4402516 0.4528302 0.4528302 0.4528302 0.4591195
 [71] 0.4591195 0.4654088 0.4654088 0.4716981 0.4779874 0.4779874 0.4842767
 [78] 0.4842767 0.5031447 0.5094340 0.5094340 0.5157233 0.5220126 0.5220126
 [85] 0.5220126 0.5283019 0.5471698 0.5471698 0.5471698 0.5471698 0.5471698
 [92] 0.5471698 0.5534591 0.5534591 0.5597484 0.5660377 0.5660377 0.5660377
 [99] 0.5660377 0.5660377 0.5660377 0.5723270 0.5786164 0.5786164 0.5849057
[106] 0.5849057 0.5911950 0.6037736 0.6037736 0.6037736 0.6037736 0.6100629
[113] 0.6100629 0.6226415 0.6289308 0.6289308 0.6289308 0.6477987 0.6477987
[120] 0.6477987 0.6477987 0.6540881 0.6540881 0.6603774 0.6603774 0.6603774
[127] 0.6666667 0.6666667 0.6666667 0.6666667 0.6666667 0.6666667 0.6729560
[134] 0.6729560 0.6729560 0.6729560 0.6729560 0.6792453 0.6918239 0.6918239
[141] 0.6981132 0.7044025 0.7106918 0.7106918 0.7169811 0.7169811 0.7169811
[148] 0.7169811 0.7169811 0.7169811 0.7169811 0.7169811 0.7169811 0.7232704
[155] 0.7232704 0.7232704 0.7232704 0.7232704 0.7232704 0.7232704 0.7358491
[162] 0.7358491 0.7358491 0.7358491 0.7484277 0.7484277 0.7484277 0.7547170
[169] 0.7547170 0.7610063 0.7610063 0.7610063 0.7610063 0.7610063 0.7610063
[176] 0.7672956 0.7735849 0.7735849 0.7861635 0.7924528 0.7924528 0.7924528
[183] 0.7987421 0.8050314 0.8113208 0.8176101 0.8238994 0.8238994 0.8238994
[190] 0.8238994 0.8301887 0.8364780 0.8364780 0.8364780 0.8427673 0.8427673
[197] 0.8427673 0.8490566 0.8490566 0.8553459 0.8553459 0.8553459 0.8553459
[204] 0.8553459 0.8553459 0.8553459 0.8616352 0.8742138 0.8805031 0.8867925
[211] 0.8930818 0.8930818 0.8930818 0.8930818 0.8993711 0.9119497 0.9119497
[218] 0.9119497 0.9245283 1.0000000 1.0000000

attr(,"class")
[1] "AUC"         "sensitivity"
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>