1.0 - 8.00 - CoxHazardRatio Example 5: Units 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)

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 cox_coef_model DIMENSION
  ON (SELECT id, name, karno * (1.1) as karno,
             diagtime * (1) AS diagtime,
             age * (0.9) AS age
        FROM lc_new_predictors) AS predicts PARTITION BY 1
  USING
  PredictFeatureNames ('karno','diagtime','age')
  PredictFeatureUnitsColumns ('karno','diagtime','age')
  ACCUMULATE ('id','name')
) AS dt ORDER BY 1, 2, 3, 4, 5, 6;

Output

Numerical attributes are scaled by the unit values for comparison.

id name karno_units diagtime_units age_units hazardratio
1 John 33.0 4 56.7 0.206751516164483
2 James 88.0 12 36.9 0.0404357176452642
3 Stella 77.0 3 64.8 0.0454693988565714
4 Steffi 66.0 5 56.7 0.070013860059579