1.1 - 8.10 - CoxSurvival Example - Teradata Vantage

Teradata Vantage™ - Machine Learning Engine Analytic Function Reference

Product
Teradata Vantage
Release Number
1.1
8.10
Release Date
October 2019
Content Type
Programming Reference
Publication ID
B700-4003-079K
Language
English (United States)

Input

SQL Call

SELECT * FROM CoxSurvival (
  ON lungcancer_lp AS CoxLinearPredictors
  ON lungcancer_coef AS CoxCoefModel
  ON lc_new_predictors AS PredictTable
  OUT TABLE OutputTable (lungcancer_survival_out)
  USING
  PredictFeatureNames ('trt','celltype','karno','diagtime','age','prior')
  PredictFeatureColumns ('trt','celltype','karno','diagtime','age','prior')
  Accumulate ('id','name')
) AS dt;

Output

 result_col                                                     
 -------------------------------------------------------------- 
 Survival functions are successfully generated in output table.
SELECT * FROM lungcancer_survival_out;
 id name   time_interval survival_prob         
 -- ------ ------------- --------------------- 
  3 stella             4     0.977170773799263
  3 stella             1    0.9909783601721555
  2 james              4    0.9898034044749178
  2 james              1    0.9959861478722662
  3 stella             8     0.942903382247263
  3 stella            13    0.9067849193215634
  2 james              8    0.9742460761878555
  2 james             13    0.9575040312869677
  3 stella            12    0.9172162394329308
  3 stella            21    0.8381545882545863
  2 james             12    0.9623767882316671
  2 james             21     0.924637754239321
  3 stella            16    0.8908370983918913
  3 stella            25    0.7984816187245628
  2 james             16    0.9499937073848205
  2 james             25    0.9049522217750622
  3 stella            20    0.8506528052960909
  3 stella            29    0.7846449236378263
  2 james             20     0.930731540070297
  2 james             29    0.8979589169777041
  3 stella            24    0.8186894777338398
  3 stella            33    0.7495652251020797
  2 james             24    0.9150455841167567
  2 james             33    0.8799156398244069
  3 stella            36    0.7353180870307118
  3 stella            45    0.7065247075450533
  2 james             36    0.8724536584804404
  2 james             45    0.8571236081709573
  3 stella            44    0.7136983787504159
  3 stella            49    0.6910458397409109
  2 james             44    0.8609750067624526
  2 james             49     0.848738548425124
  3 stella            48    0.6991381529593769
  3 stella            53     0.630026684810563
  2 james             48    0.8531351202524168
  2 james             53    0.8146226485485744
  3 stella            52    0.6390208563638063
  3 stella            61    0.5851792553642852
  2 james             52    0.8197633960584318
  2 james             61    0.7883588752295321
  3 stella            56    0.6031899369645713
  3 stella            73    0.5576185939174934
  2 james             56     0.799036461367838
  2 james             73     0.771659505447999
  3 stella            72    0.5667881616725329
  3 stella           105   0.41077648878001943
  2 james             72    0.7772654142726578
  2 james            105    0.6737829928223186
  3 stella            80    0.5386537861777854
  3 stella           117   0.34653610073807567
  2 james             80    0.7599002123347435
  2 james            117    0.6248023111994373
  3 stella            84    0.5185427947197233
  3 stella           133    0.2939220668451549
  2 james             84    0.7471758074514165
  2 james            133    0.5807698292208041
  3 stella            92    0.4873980005957884
  3 stella           153   0.23169302410285983
  2 james             92    0.7269161723479345
  2 james            153    0.5225784248744928
  3 stella           100   0.43305331751144766
  3 stella           177   0.18082902084175786
  2 james            100    0.6897613203041406
  2 james            177   0.46814374750038373
  3 stella           112   0.36742105032740585
  3 stella           201   0.15150481843050578
  2 james            112    0.6412419471537462
  2 james            201    0.4327900454115621
  3 stella           132    0.3045321166754255
  3 stella           260   0.09625498957522866
  2 james            132    0.5899821804460031
  2 james            260   0.35387363618185147
  3 stella           140   0.27318807424484776
  3 stella           340  0.056078555391243186
  2 james            140     0.562217647638017
  2 james            340    0.2784339216258729
  3 stella           144   0.25250832511588306
  3 stella           384   0.03601622982601577
  2 james            144    0.5429162969735154
  2 james            384   0.22876046974366096
  3 stella           156     0.221081852380258
  3 stella           392  0.023847059171361287
  2 james            156    0.5118183680307824
  2 james            392   0.19050812795022798
  3 stella           164   0.19062251468039026
  3 stella           587  0.003350791741946342
  2 james            164   0.47923091501385895
  2 james            587   0.07973932058949672
  3 stella           200   0.16103894279140352
  3 stella             2    0.9864425596922993
  2 james            200    0.4446720322334919
  2 james              2    0.9939604281289419
  3 stella           216   0.14232329546610742
  3 stella            10    0.9326815744370015
  2 james            216   0.42094758687640726
  2 james             10    0.9695446843319574
  3 stella           228   0.13309463890962756
  3 stella            18    0.8742484075847589
  2 james            228    0.4086078813982495
  2 james             18    0.9421017960036334
  3 stella           283   0.07935643098759568
  3 stella            22     0.831701476784412
  2 james            283     0.324817880155006
  2 james             22    0.9214716019355508
  3 stella           287   0.07162504865688243
  3 stella            30    0.7705903386299333
  2 james            287     0.310372627721065
  2 james             30    0.8907849051708528
  3 stella           411   0.01639723897597117
  3 stella            42     0.728086755824867
  2 james            411    0.1613332845642425
  2 james             42    0.8686354457989913
  3 stella           467  0.010630461654689258
  3 stella            54    0.6120966170601181
  2 james            467    0.1331047275120861
  2 james             54    0.8042512581076294
  3 stella             3    0.9818501982666858
  3 stella            82    0.5286503050452671
  2 james              3    0.9919041628384534
  2 james             82    0.7536045777904845
  3 stella             7    0.9628238391265018
  3 stella            90    0.4980679672768512
  2 james              7    0.9833274563958035
  2 james             90    0.7339359577127945
  3 stella            11    0.9275236570060585
  3 stella           110    0.3996973818421488
  2 james             11    0.9671614833590173
  2 james            110    0.6656566874896158
  3 stella            15    0.8961797330004581
  3 stella           118   0.33616785866361215
  2 james             15    0.9525179885011461
  2 james            118    0.6164359388967089
  3 stella            19    0.8626543265601813
  3 stella           122    0.3260004703774689
  2 james             19    0.9365364561867652
  2 james            122    0.6080910742009128
  3 stella            27    0.7915671604747438
  3 stella           126   0.31517633036999687
  2 james             27    0.9014660343106818
  2 james            126    0.5990465022372163
  3 stella            31      0.75657402224087
  3 stella           162   0.20056801562028564
  2 james             31    0.8835575754377013
  2 james            162     0.490170469599537
  3 stella            35    0.7425113388510836
  3 stella           186   0.17087795784454451
  2 james             35    0.8762310999819629
  2 james            186   0.45653052173163694
  3 stella            43    0.7208979769333729
  3 stella           242   0.11463674170051268
  2 james             43    0.8648187367106307
  2 james            242   0.38241288419086134
  3 stella            51    0.6656405410159184
  3 stella           250   0.10528370945526194
  2 james             51    0.8347466249436057
  2 james            250     0.368238056820853
  3 stella            59    0.5943170160306547
  3 stella           357  0.048878786848977826
  2 james             59    0.7937986688632871
  2 james            357   0.26196185078498124
  3 stella            63    0.5760402614187746
  3 stella           389   0.02945586324042478
  2 james             63    0.7828708831771929
  2 james            389   0.20923094109432208
  3 stella            87    0.5083998027052177
  3 stella           991   9.97739210176136E-4
  2 james             87    0.7406540141654021
  2 james            991   0.04657774222728845
  3 stella            95    0.4659676473779151
  3 stella           999  2.649541154475802E-5
  2 james             95    0.7125542084820258
  2 james            999  0.009307338683992543
  3 stella            99   0.44398002229441696
  4 steffi             1    0.9797788143757056
  2 james             99    0.6974315880842962
  1 john               1    0.9877627218694728
  3 stella           103    0.4220511450308619
  4 steffi            13    0.8020625205630331
  2 james            103    0.6819285217204268
  1 john              13    0.8755152163235578
  3 stella           111   0.37808916044242735
  4 steffi            21    0.6716777380749346
  2 james            111    0.6494390261905569
  1 john              21    0.7867291113730132
  3 stella           139    0.2834745192049802
  4 steffi            25    0.6021300692146838
  2 james            139    0.5715160112209241
  1 john              25    0.7365689029397213
  3 stella           143     0.262699843463888
  4 steffi            29    0.5788650800903214
  2 james            143    0.5525341223424671
  1 john              29    0.7192815692039345
  3 stella           151    0.2422067930447939
  4 steffi            33    0.5221574403574948
  2 james            151    0.5329726201609251
  1 john              33    0.6759448984151094
  3 stella           231   0.12412278160814307
  4 steffi            45   0.45699366206364067
  2 james            231   0.39614641073130913
  1 john              45    0.6237616099569269
  3 stella           278   0.08768597720900355
  4 steffi            49    0.4347345107865623
  2 james            278    0.3395295411739342
  1 john              49    0.6052682122376288
  3 stella           314   0.06374795222976015
  4 steffi            53    0.3529593043469775
  2 james            314    0.2947324547233812
  1 john              53    0.5338280302223776
  3 stella           378  0.042194126599600215
  4 steffi            61     0.298836706249115
  2 james            378    0.2454107365964567
  1 john              61   0.48286954247030844
  3 stella           553  0.006561353072584274
  4 steffi            73    0.2680437519835255
  2 james            553   0.10744651813639745
  1 john              73   0.45223488899012027
  4 steffi             4    0.9492747226911316
  4 steffi           105   0.13458863217703873
  1 john               4    0.9691109375794282
  1 john             105   0.29855870160319736
  4 steffi             8     0.875881155109985
  4 steffi           117   0.09173251269010738
  1 john               8    0.9232305157057334
  1 john             117   0.23696524584743014
  4 steffi            12    0.8230109256455472
  4 steffi           133   0.06328703125585987
  1 john              12     0.889227042595389
  1 john             133   0.18946102463183845
  4 steffi            16    0.7706155059912168
  4 steffi           153    0.0370183878051513
  1 john              16     0.854661301010145
  1 john             153   0.13713439991154908
  4 steffi            20    0.6944662084233859
  4 steffi           177  0.021172382734674866
  1 john              20    0.8027102997126492
  1 john             177   0.09792555086958707
  4 steffi            24    0.6370265325414879
  4 steffi           201   0.01420878440966958
  1 john              24    0.7620095738915534
  1 john             201   0.07700092905799856
  4 steffi            36    0.5000517625586116
  4 steffi           260  0.005110717214656548
  1 john              36    0.6585490940486227
  1 john             260   0.04157572941876624
  4 steffi            44     0.467519729826351
  4 steffi           340 0.0015121618944563759
  1 john              44    0.6323819602392117
  1 john             340  0.019955720577251486
  4 steffi            48   0.44629439996197384
  4 steffi           384  5.573501927956976E-4
  1 john              48    0.6149181895092004
  1 john             384  0.010934607809126909
  4 steffi            52    0.3644193186409857
  4 steffi           392  2.200351450833247E-4
  1 john              52    0.5442084384983767
  1 john             392  0.006244832408333171
  4 steffi            56    0.3199707068487917
  4 steffi           587 2.6381958128534726E-6
  1 john              56    0.5031720523333055
  1 john             587  4.340807022220839E-4
  4 steffi            72     0.278082093972301
  4 steffi             2    0.9696989861155152
  1 john              72    0.4623682571922151
  1 john               2    0.9816252528322383
  4 steffi            80   0.24793129945859704
  4 steffi            10     0.854622824648725
  1 john              80    0.4314665041479958
  1 john              10    0.9096590271392879
  4 steffi            84   0.22755230884756295
  4 steffi            18    0.7386455760285279
  1 john              84    0.4097278025445349
  1 john              18     0.833111003891248
  4 steffi            92   0.19789855677084545
  4 steffi            22    0.6600769188651047
  1 john              92   0.37665773837147154
  1 john              22    0.7785109792046704
  4 steffi           100   0.15160346650334533
  4 steffi            30    0.5557546960121054
  1 john             100   0.32076810517582033
  1 john              30     0.701833592888329
  4 steffi           112   0.10466796810220134
  4 steffi            42    0.4890349280373397
  1 john             112     0.256575506886626
  1 john              42    0.6497656092101878
  4 steffi           132   0.06855366947775209
  4 steffi            54   0.33071957857385764
  1 john             132   0.19881271023036698
  1 john              54    0.5132931345103812
  4 steffi           140  0.053666008824721466
  4 steffi            82   0.23767296842688945
  1 john             140   0.17153601734933632
  1 john              82   0.42061630060079824
  4 steffi           144   0.04494059206088333
  4 steffi            90   0.20779860417529777
  1 john             144   0.15413769666459673
  1 john              90    0.3879044024664674
  4 steffi           156   0.03330606163295575
  4 steffi           110    0.1265441180230318
  1 john             156   0.12867219807597144
  1 john             110    0.2876715335777685
  4 steffi           164   0.02384533770524679
  4 steffi           118   0.08566153503920494
  1 john             164   0.10520032444455386
  1 john             118   0.22738462506313298
  4 steffi           200    0.0163042944225055
  4 steffi           122   0.07993188700059267
  1 john             200   0.08365770524734581
  1 john             122   0.21809194764525022
  4 steffi           216  0.012341151508442855
  4 steffi           126   0.07407365276602051
  1 john             216   0.07073075892099578
  1 john             126    0.2083126769744118
  4 steffi           228   0.01061023718074388
  4 steffi           162  0.026741884833024733
  1 john             228   0.06457300251462937
  1 john             162   0.11272648892265719
  4 steffi           283 0.0033074344382343916
  4 steffi           186  0.018636226824033274
  1 john             283   0.03198380389417652
  1 john             186   0.09067714964205509
  4 steffi           287 0.0026250811315950877
  4 steffi           242  0.007578325829849537
  1 john             287  0.027825779785038553
  1 john             242   0.05271829024934172
  4 steffi           411  9.458505018651723E-5
  4 steffi           250  0.006255382096463986
  1 john             411 0.0037542146881367868
  1 john             250  0.046961551500778256
  4 steffi           467  3.560813518257045E-5
  4 steffi           357 0.0011093756693298176
  1 john             467  0.002083522051985887
  1 john             357  0.016557271559752104
  4 steffi             3     0.959552512629006
  4 steffi           389 3.5422645701199614E-4
  1 john               3    0.9754215530836501
  1 john             389  0.008320666008526633
  4 steffi             7    0.9181466846968994
  4 steffi           991 1.7192115838149894E-7
  1 john               7    0.9498304739372285
  1 john             991  8.370464573367155E-5
  4 steffi            11    0.8440060982483081
  4 steffi           999 4.820950180206241E-11
  1 john              11    0.9028310496797299
  1 john             999  6.049845764264929E-7
  4 steffi            15    0.7810725538699188
  1 john              15    0.8616327215877917
  4 steffi            19    0.7167478982867556
  1 john              19    0.8181358519299974
  4 steffi            27    0.5904403601061408
  1 john              27    0.7279165482300622
  4 steffi            31    0.5332277481119607
  1 john              31     0.684546421244605
  4 steffi            35    0.5111462254777396
  1 john              35    0.6673171157161161
  4 steffi            43    0.4782180981308061
  1 john              43    0.6410647661071909
  4 steffi            51    0.3995357316249257
  1 john              51    0.5752369457916761
  4 steffi            59    0.3094586843787704
  1 john              59   0.49314248563304175
  4 steffi            63   0.28841933616451565
  1 john              63   0.47265259664121717
  4 steffi            87   0.21764182527686604
  1 john              87   0.39887733816764287
  4 steffi            95    0.1788230923969474
  1 john              95   0.35433612688443816
  4 steffi            99   0.16036282311786482
  1 john              99    0.3318137985680625
  4 steffi           103    0.1430592967610842
  1 john             103    0.3097466704987922
  4 steffi           111    0.1116434713825435
  1 john             111    0.2667493262009096
  4 steffi           139  0.058328874311235755
  1 john             139   0.18037011398447858
  4 steffi           143   0.04913312481408222
  1 john             143     0.162650670871733
  4 steffi           151   0.04091311813187214
  1 john             151   0.14565719343802414
  4 steffi           231  0.009065752715054977
  1 john             231  0.058731612774385544
  4 steffi           278  0.004141944279102446
  1 john             278  0.036628943583010866
  4 steffi           314  0.002018764257289634
  1 john             314   0.02375210053138975
  4 steffi           378  7.963601874800554E-4
  1 john             378  0.013558595161683963
  4 steffi           553 1.1999747385276588E-5
  1 john             553  0.001081642140064917

Download a zip file of all examples and a SQL script file that creates their input tables from the attachment in the left sidebar.