1.0 - 8.00 - CoxSurvival Example - 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

SQL Call

SELECT * FROM CoxSurvival (
  ON lungcancer_lp AS Cox_Linear_Predictor_Model_Table
  ON lungcancer_coef AS Cox_Coef_Model_Table
  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.

This query returns the following table:

SELECT * FROM lungcancer_survival_out ORDER BY 1, 3;
id name time_interval survival_prob
1 John 1 0.9877627218694728
1 John 2 0.9816252528322383
1 John 3 0.9754215530836501
1 John 4 0.9691109375794283
1 John 7 0.9498304739372286
1 John 8 0.9232305157057336
1 John 10 0.909659027139288
... ... ... ...
2 James 1 0.9959861478722662
2 James 2 0.9939604281289419
2 James 3 0.9919041628384534
2 James 4 0.9898034044749178
2 James 7 0.9833274563958035
2 James 8 0.9742460761878555
2 James 10 0.9695446843319574
... ... ... ...
3 Stella 1 0.9909783601721555
3 Stella 2 0.9864425596922994
3 Stella 3 0.981850198266686
3 Stella 4 0.9771707737992631
3 Stella 7 0.9628238391265019
3 Stella 8 0.9429033822472632
3 Stella 10 0.9326815744370016
... ... ... ...
4 Steffi 1 0.9797788143757056
4 Steffi 2 0.9696989861155152
4 Steffi 3 0.959552512629006
4 Steffi 4 0.9492747226911316
4 Steffi 7 0.9181466846968994
4 Steffi 8 0.875881155109985
4 Steffi 10 0.8546228246487249