roc - scikit-learn roc_curve: why does it return a threshold value = 2 some time? -


Text after "div class =" itemprop = "text">

Correct me if I am wrong: "Threshold" to be a array of scikit learning that the numbers returned by roc_curve are given In [0,1] should, however, sometimes it gives me an array with the first number near "2". Is this a bug or did I wrong? . Thanks

  In [1]: Import as numpy in NP [2]: from sklearn.metrics to roc_curve import [3]: np.random.seed (11) [4]: Aa = np.random.choice ([true, wrong], 100) [5]: bb = np.random.uniform (0,1,100) [6] in: fpr, tpr, threshold = roc_curve (aa, b B) in [7]: Threshold Out [7]: Array ([1.97396826, 0.97396826, 0.93274463, 0.95941372, 0.93214862, 0.93076592, 0.92960511, 0.92245024, 0.91179548, 0.91112166, 0.87529458, 0.84493853, 0.84068543, 0.83303741, 0.82565223, 0.81096657, 0.80656679, 0.79387241, 0.77054807, 0.76763223, 0.7644911, 0.75964947, 0.73995152, 0.73825262, 0.73466772, 0.73421299, 0.73282534, 0.72391126, 0.71296292, 0.70930102, 0.70116428, 0.69606617, 0.65869235, 0.65670881, 0.65261474, 0.6487222, 0.64805644, 0.64221486, 0.62699782, 0.62522484, 0.62283401, 0.61 601839, 0.611632, 0.59548669, 0.57555854, 0.56828967, 0.55652111, 0.55023947, 0.53825029, 0.53369398, 0.52157349, 0.51900774, 0.50547317, 0.49749635, 0.493913, 0.46154029, 0.45275916, 0.44777116, 0.43822067, 0.43795921, 0.43624093, 0.42039077, 0.41866343, 0.41550367, 0.40032843, 0.36761763, 0.36642721, 0.36567017, 0.36148354, 0.35843793, 0.34371331, 0.33436415, 0.33408289, 0.33387442, 0.31887024, 0.31818719, 0.31367915, 0.30216469, 0.30097917, 0.29995201, 0.28604467, 0.26930354, 0.2383461, 0.22803687, 0.21800338, 0.19301808, 0.16902881, 0.1688173, 0.14491946, 0.13648451, 0.12704826, 0.09141459, 0.08569481, 0.07500199, 0.06288762, 0.02073298, 0.01 934336])    

time These boundaries could false to plot the area under the curve against the true positive rate, or plotting Most of Atmk are not used for example in the rate.

Still looking like a proper curve, for conspiracy, there is a 0 data point that a threshold is needed because the Scikit-Learn's ROC curve function has normalized probabilities for threshold (someone Even fine score is not required), setting the threshold of this point to 1 is not enough; To set it, inf is sensible, but the riders often expect finite data (and it is possible that the implementation also works for integer thresholds). Instead, the implementation uses maximum (score) + epicilon where epsilon = 1 occurs. It may be cosmetic, but you have not told it any problem for some reason!

Comments

Popular posts from this blog

Verilog Error: output or inout port "Q" must be connected to a structural net expression -

jasper reports - How to center align barcode using jasperreports and barcode4j -

c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -