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

Machine Learning Engine Analytic Function Reference

Product
Teradata Vantage
Release Number
8.00
1.0
Published
May 2019
Language
English (United States)
Last Update
2019-11-22
dita:mapPath
blj1506016597986.ditamap
dita:ditavalPath
blj1506016597986.ditaval
dita:id
B700-4003
lifecycle
previous
Product Category
Teradata Vantageā„¢

Input

The input table is housing_train, as in GLM Example 3: Gaussian Distribution Analysis with Default Options.

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
    FeatureColumns ('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)
    Lambda (0.02)
    Randomization ('t')
  ) AS dt
) WITH DATA;

Output

housing_model
attribute category estimate information
(Intercept)   16975.5082421567 p
driveway yes 2822.64319583435 p
recroom yes 1208.48422621322 p
fullbase yes 3588.31635406472 p
gashw yes 5787.02116797583 p
airco yes 6478.76213487311 p
prefarea yes 6465.59515171777 p
homestyle Eclectic 16550.8330586448 p
homestyle bungalow 54128.4244993102 p
lotsize   2.08097633429999 p
bedrooms   782.136874756127 p
bathrms   6772.3377658822 p
stories   2445.64482074556 p
garagepl   1483.10124561545 p
Family     Gaussian
Regularization     Lasso
Alpha   1  
Lambda   0.02  
Iterations #   45  
Converged     true
Rows #   492  
Features #   13  
RMSE   10385.6617634216  
AIC   -8.99272582914559  
BIC   49.7859762017467  

(housing_factor_table not shown here.)