GLML1L2 Example: LASSO, Family ('GAUSSIAN') | Teradata Vantage - GLML1L2 Example: LASSO, Family ('GAUSSIAN') - Teradata Vantage

Machine Learning Engine Analytic Function Reference

Product
Teradata Vantage
Release Number
9.02
9.01
2.0
1.3
Published
February 2022
Language
English (United States)
Last Update
2022-02-10
dita:mapPath
rnn1580259159235.ditamap
dita:ditavalPath
ybt1582220416951.ditaval
dita:id
B700-4003
lifecycle
previous
Product Category
Teradata Vantageā„¢

Input

The input table is housing_train, as in GLM Example: Gaussian Distribution Analysis.

SQL Call

Because the response variable has a Gaussian distribution, the call specifies Family ('GAUSSIAN'). Alpha (1) indicates L1 (LASSO) regularization.

DROP TABLE housing_model;
DROP TABLE housing_factor_table;

CREATE MULTISET TABLE housing_model AS (
  SELECT * FROM GLML1L2 (
    ON housing_train AS InputTable
    OUT TABLE FactorTable (housing_factor_table)
    USING
    TargetColumns ('lotsize','bedrooms','bathrms','stories','garagepl','driveway',
      'recroom','fullbase','gashw','airco','prefarea','homestyle')
    CategoricalColumns ('driveway','recroom','fullbase','gashw','airco','prefarea','homestyle') 
    ResponseColumn ('price') 
    Family ('GAUSSIAN') 
    Alpha (1)
    RegularizationLambda (0.02)
  ) AS dt
) WITH DATA;

Output

SELECT * FROM housing_model;
 attribute      category estimate            information 
 -------------- -------- ------------------- ----------- 
 AIC            NULL      -8.992753699712395 NULL       
 Iterations #   NULL                    53.0 NULL       
 stories        NULL      2445.6699824701327 p          
 bathrms        NULL       6772.387864268141 p          
 homestyle      classic  -54128.100924908955 p          
 Alpha          NULL                     1.0 NULL       
 homestyle      eclectic  -37577.28812836616 p          
 prefarea       yes        6465.606895601109 p          
 Features #     NULL                    13.0 NULL       
 airco          yes        6478.800674992518 p          
 Lambda         NULL                    0.02 NULL       
 fullbase       yes        3588.313479183023 p          
 Family         NULL                    NULL Gaussian   
 recroom        yes       1208.5016271782713 p          
 Converged      NULL                    NULL true       
 bedrooms       NULL       782.1333264902945 p          
 Rows #         NULL                   492.0 NULL       
 gashw          yes        5787.049927907821 p          
 driveway       yes       2822.6466305663917 p          
 Regularization NULL                    NULL Lasso      
 RMSE           NULL      10385.734127243657 NULL       
 lotsize        NULL       2.080984013010899 p          
 BIC            NULL       49.78594833117991 NULL       
 (Intercept)    NULL       71103.48563681456 p          
 garagepl       NULL      1483.1186058015555 p

(housing_factor_table not shown here.)

Download a zip file of all examples and a SQL script file that creates their input tables.