1.0 - 8.00 - GLM2 Example 2: Ridge for Logistic Regression Analysis - 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 logistic regression to predict which students are admitted to an academic program.

Input

SQL Call

Because the example uses logistic regression, the Family is Binomial. The Alpha value, 0, specifies a Ridge model.

SELECT * FROM GLM2 ( 
  ON admissions_train AS InputTable
  OUT TABLE ModelTable (glm2_ridge_model)
  OUT TABLE RegularizationTable (glm2_2regularization)
  USING
  InputColumns ('masters', 'gpa', 'stats', 'programming')
  CategoricalColumns ('masters', 'stats', 'programming')
  ResponseColumn ('admitted')
  Family ('binomial')
  Intercept ('TRUE')
  NumLambdas (10)
  Alpha(0)
) AS dt;

Output

Onscreen Output
dfDevRatio devRatio dfDev deviance lambda
0 0 39 51.7957311227706 216.083130280731
6 0.00164825659995313 33 51.7103584670981 77.6562506120565
6 0.00453438694628144 33 51.5608692356944 27.9082094529445
6 0.0122307765430854 33 51.1622291095222 10.0296904464313
6 0.0313506707268246 33 50.1719002112855 3.60448385701157
6 0.0714771723905868 33 48.0935187202118 1.29538433362914
6 0.132326934855416 33 44.9417607846991 0.465536991807485
6 0.191442862387798 33 41.8798080971586 0.167305320216424
6 0.228448387997473 33 39.9630798426231 0.0601264145820994
6 0.2437883725835 33 39.1685341255778 0.0216083130280731
glm2_2regularization
df_dev_ratio deviance_ratio df_dev deviance lambda intercept gpa masters_yes programming_beginner programming_novice stats_beginner stats_novice
0 0 39 51.7957311227706 216.083130280731 0.6190392084 -0 -0 -0 0 -0 -0
6 0.00164825659995313 33 51.7103584670981 77.6562506120565 0.6244703657 -0.0002657335 -0.0055716531 -0.0050407358 0.0013575168 -0.000727557 -0.0002425326
6 0.00453438694628144 33 51.5608692356944 27.9082094529445 0.6340226614 -0.0007208063 -0.0153981003 -0.0139177768 0.0037043543 -0.0019840785 -0.0006762965
6 0.0122307765430854 33 51.1622291095222 10.0296904464313 0.6597683095 -0.0018694488 -0.0420539111 -0.0379125023 0.0097655079 -0.0052208953 -0.001889708
6 0.0313506707268246 33 50.1719002112855 3.60448385701157 0.7256166026 -0.0042964122 -0.1113489309 -0.0996760118 0.0234260316 -0.0124548896 -0.0052622636
6 0.0714771723905868 33 48.0935187202118 1.29538433362914 0.8750560357 -0.0072555821 -0.2739921211 -0.240858846 0.043509692 -0.0227188283 -0.013970035
6 0.132326934855416 33 44.9417607846991 0.465536991807485 1.1529184558 -0.0062498019 -0.5862205516 -0.4961953742 0.0348997352 -0.016655652 -0.0306068568
6 0.191442862387798 33 41.8798080971586 0.167305320216424 1.5819520541 -0.0054173069 -1.0345059039 -0.8337267959 -0.0842809189 0.0476614506 -0.0454722578
6 0.228448387997473 33 39.9630798426231 0.0601264145820994 2.1411288741 -0.0253104343 -1.5024463472 -1.1771181428 -0.3400969929 0.1821811309 -0.0393956514
6 0.2437883725835 33 39.1685341255778 0.0216083130280731 2.6727140074 -0.0610158153 -1.8601449007 -1.4574162679 -0.6238441031 0.3326284335 -0.0126211852