1.0 - 8.00 - ROC Example 1: Show Only ROC Values - Teradata Vantage

Teradata® Vantage Machine Learning Engine Analytic Function Reference

Product
Teradata Vantage
Release Number
1.0
8.00
Release Date
May 2019
Content Type
Programming Reference
Publication ID
B700-4003-098K
Language
English (United States)

Input

The input table has data from four different models, each of which outputs the same probability for each observation.

roctable
model id probability obs
1 1 0.324 p
1 2 0.534 p
1 3 0.831 n
1 4 0.429 n
1 5 0.488 p
1 6 0.598 p
1 7 0.666 n
1 8 0.493 p
1 9 0.723 p
1 10 0.512 n
2 1 0.324 p
2 2 0.534 p
... ... ... ...
2 10 0.512 n
3 1 0.324 p
3 2 0.534 p
... ... ... ...
3 10 0.512 n
4 1 0.324 p
4 2 0.534 p
... ... ... ...
4 10 0.512 n

SQL Call

In this call, the ROCValues, AUC, and Gini arguments default to the values 'true', 'false', and 'false', respectively.

SELECT * FROM ROC (
  ON roctable AS InputTable
  OUT TABLE OutputTable (rocoutput20)
  USING
  ModelIDColumn ('model')
  ProbabilityColumn ('probability')
  ObsColumn ('obs')
  PositiveClass ('p')
  NumThreshold (100)
) AS dt;

Output

info
ROC complete.
rocoutput20
model threshold tpr fpr
1 1 0 0
1 0.98989898989899 0 0
1 0.97979797979798 0 0
1 0.96969696969697 0 0
1 0.95959595959596 0 0
1 0.94949494949495 0 0
1 0.939393939393939 0 0
1 0.929292929292929 0 0
1 0.919191919191919 0 0
1 0.909090909090909 0 0
1 0.898989898989899 0 0
1 0.888888888888889 0 0
1 0.878787878787879 0 0
1 0.868686868686869 0 0
1 0.858585858585859 0 0
1 0.848484848484849 0 0
1 0.838383838383838 0 0
1 0.828282828282828 0 0.25
1 0.818181818181818 0 0.25
1 0.808080808080808 0 0.25
1 0.797979797979798 0 0.25
... ... ... ...