1.1 - 8.10 - CoxHazardRatio Example: Units Values - 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)

A standard value or unit value is a value against which an application makes comparisons. Unit values apply only to numerical variables. This example increases the variable karno by 10%, decreases the variable age by 10%, leaves the variable diagtime unchanged, and calculates the hazard ratios.

Input

SQL Call

SELECT * FROM CoxHazardRatio (
  ON lungcancer_coef AS CoxCoeffModel DIMENSION
  ON (SELECT id, name, karno * (1.1) as karno,
             diagtime * (1) AS diagtime,
             age * (0.9) AS age
        FROM lc_new_predictors) AS PredictorValues PARTITION BY 1
  USING
  PredictFeatureNames ('karno','diagtime','age')
  PredictFeatureUnitsColumns ('karno','diagtime','age')
  Accumulate ('id','name')
) AS dt;

Output

Numerical attributes are scaled by the unit values for comparison.

 id name   karno_units diagtime_units age_units hazardratio          
 -- ------ ----------- -------------- --------- -------------------- 
  4 steffi          66              5      56.7  0.07001386005957994
  3 stella          77              3      64.8 0.045469398856572085
  1 john            33              4      56.7  0.20675151616448595
  2 james           88             12      36.9  0.04043571764526463

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