1.0 - 8.00 - GLML1L2 Example 1: Ridge Regression, Family ('BINOMIAL') - 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)

Input

The input table is admission_train, as in GLM Example 1: Logistic Regression Analysis with Intercept.

SQL Call

Because the response variable is binary (the admitted column has two possible values), the call specifies Family ('BINOMIAL'). Alpha (0) indicates L2 (ridge regression) regularization.

DROP TABLE admissions_model;
DROP TABLE admissions_factor_table;

CREATE MULTISET TABLE admissions_model AS (
  SELECT * FROM GLML1L2 (
   ON admissions_train AS InputTable
   OUT TABLE FactorTable (admissions_factor_table)
   USING
   FeatureColumns ('masters', 'gpa', 'stats', 'programming')
   CategoricalColumns ('masters', 'stats', 'programming') 
   ResponseColumn ('admitted') 
   Family ('BINOMIAL') 
   Alpha (0)
   Lambda (0.02)
   Randomization ('t')
  ) AS dt
) WITH DATA;

Output

admissions_model
attribute category estimate information
(Intercept)   0.383816240766463 p
masters yes -1.26525302726537 p
stats Beginner 0.0806346550146325 p
stats Novice -0.0267165533072416 p
programming Beginner -1.02594302137308 p
programming Novice -0.0820786516340258 p
gpa   0.383464234338727 p
Family     Binomial
Regularization     Ridge
Alpha   0  
Lambda   0.02  
Iterations #   28  
Converged     true
Rows #   40  
Features #   6  
AIC   15.2192798193498  
BIC   27.0414359981473  
admissions_factor_table
masters_yes stats_Beginner stats_Novice programming_Beginner programming_Novice gpa admitted td_randomized_id
1 1 0 1 0 3.95 0 1569741360
0 0 1 1 0 3.7 1 516548029
1 0 1 0 1 2.33 1 1182054491
0 1 0 0 0 3.6 1 251269761
0 0 0 0 0 3.13 1 715581077
0 0 1 0 1 3.65 1 542832677
1 0 0 0 0 3.45 0 1316484262
0 0 0 0 0 3.7 1 49567875
1 0 0 0 0 1.98 0 672024888
0 0 1 1 0 3.87 1 790221947
... ... ... ... ... ... ... ...