![]() | ConfusionMatrixAUCLogistic Method |
Namespace: sqx
public static SqlDouble AUCLogistic( SqlInt64 TP, SqlInt64 FP, SqlInt64 FN, SqlInt64 TN )
WITH sample_data AS (SELECT ID, TP, FP, FN, TN FROM (VALUES (1,5,3,3,10), (2,15,3,3,10), (3,25,15,15,10), (4,30,1,1,10) , (5,5,30,30,10), (6,8999999,1,1,1000000)) AS T(ID, TP, FP, FN, TN)) SELECT sample_data.ID, TP, FP, FN, TN --, sqm.AUCNormal(TP, FP, FN, TN) AUCNormal , sqx.AUCLogistic(TP, FP, FN, TN) AUCLogistic , sqx.AUC(TP, FP, FN, TN) AUCEmpirical FROM sample_data /* ID TP FP FN TN AUCNormal AUCLogistic AUCEmpirical ---- ------- ---- ---- ------- ---------------------- ---------------------- ---------------------- 1 5 3 3 10 0.772156033051666 0.770749053135922 0.697115384615385 2 15 3 3 10 0.885845129435223 0.87967771920109 0.801282051282051 3 25 15 15 10 0.518412065482666 0.518616673707376 0.5125 4 30 1 1 10 0.987815722267858 0.982590617161795 0.93841642228739 5 5 30 30 10 0.109007673396971 0.114680208174218 0.196428571428571 6 8999999 1 1 1000000 0.999999999998921 0.999999999308221 0.999999444444944*/