1.0 - 8.00 - GLM2 Example 4: Lambda - 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)

This example uses the same elastic net and Gaussian regression as GLM2 Example 3: Elastic Net for Gaussian Regression Analysis, but instead of specifying the number of lambdas to use, it specifies a set of specific lambda values. Teradata recommends this practice when the you have strong prior knowledge of the magnitude of lambda or want to test the results of predetermined lambda values.

Input

The input table is glm2_elastic_net, as in GLM2 Example 3: Elastic Net for Gaussian Regression Analysis.

SQL Call

The function calculates predictions only for the three specified lambda values.

SELECT * FROM GLM2 (
  ON glm2_elastic_net AS InputTable
  OUT TABLE ModelTable (glm2_elastic_net_2model)
  OUT TABLE RegularizationTable (glm2_4regularization)
  USING
  InputColumns ('gnp_deflator','gnp','armed_forces','population')
  ResponseColumn ('employed')
  Family ('GAUSSIAN')
  Intercept ('TRUE')
  Lambda (0.03,0.05,0.08)
  Alpha(0.1)
) AS dt;

Output

Onscreen Output
dfDevRatio devRatio dfDev deviance lambda
4 0.962764132079392 11 6.88896420908282 0.08
3 0.965249423725026 12 6.42916331945636 0.05
4 0.969563681197274 11 5.63098760945407 0.03
glm2_3regularization
df_dev_ratio deviance_ratio df_dev deviance lambda intercept armed_forces gnp gnp_deflator population
4 0.962764132079392 11 6.88896420908282 0.08 44.5464394715 0.0013604856 0.0232838328 0.0786912064 0.0288475833
3 0.965249423725026 12 6.42916331945636 0.05 48.2203770905 0.0011161847 0.0274548885 0.0605957447 0
4 0.969563681197274 11 5.63098760945407 0.03 55.8031821863 0.0005469725 0.0351076729 0.0348849624 -0.0663160626

The function also outputs a model table, which is not shown here.