GMM Example 3: DP-GMM, Full Covariance, Unpacked Output - 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™

Dirichlet Process GMM (DP-GMM) estimates the number of clusters in the data using an algorithm based on variational Bayesian methods.

SQL Call

DROP TABLE dpgmm_output_ex3;

SELECT * FROM GMM (
  ON (SELECT 1) AS init_params PARTITION BY 1
  ON gmm_iris_train AS InputTable
  OUT TABLE OutputTable (dpgmm_output_ex3)
  USING
  MaxClusterNum (3)
  CovarianceType ('full')
  MaxIterNum (10)
  PackOutput (0)
) AS dt;

Output

Output Message Table
property value
Output Table Table Name Specified in OutputTable argument
Algorithm Used Dirichlet Process GMM
   
Stopping Criterion Algorithm converged with tolerance 0.001
Delta Log Likelihood 0.000494
Number of Iterations 9
Number of Clusters Found 1
Covariance Type full
   
Number of Data Points 120
Global Mean [5.866, 3.055, 3.770, 1.205]
Global Covariance [[0.7197, -0.04204, 1.326, 0.5265], [-0.04204, 0.1916, -0.3241, -0.1213], 1.326, -0.3241, 3.167, 1.298], [0.5265, -0.1213, 1.298, 0.5708]]
   
Log Likelihood 1550.435
Akaike Information Criterion -3012.870 on 44 parameters
Bayesian Information Criterion -2890.220 on 44 parameters

This query returns the following table:

SELECT * FROM dpgmm_output_ex3 ORDER BY cluster_id;
dpgmm_output_ex3
cluster_id points_assigned covariance_type weight sepal_length sepal_width petal_length petal_width cov_11 cov_12 cov_13 cov_14 cov_22 cov_23 cov_24 cov_33 cov_34 cov_44 determinant prec
0 120 full 0.999991735613739 5.7341932211886 3.01843399034949 3.61166170612114 1.14486231099299 1.66229689039324 -0.214185091078124 1.69427436339271 0.693859013357687 1.14410673773899 0.0262470085044228 0.0196024370046391 4.00032158430361 1.27929539653395 1.50738875289365 6.57941093165913 [[0.7824065815292398, -0.04166719847723184, -0.2990852200079339, -0.10577545748404801], [-0.09328114699788496, 0.8754360535621004, 0.03258314800179726, 0.00390066150799786], [-0.16999962390216933, 0.13304206710705144, 0.4009441383070519, -0.26375290851001104], [-0.04690499550266552, 0.04519483233542283, -0.2524462687807997, 0.898648654482997]]
1 0 full 8.25613837088043e-06 0 0 0 0 0.166666666666667 0 0 0 0.166666666666667 0 0 0.166666666666667 0 0.166666666666667 0.000771604938271605 [[6.0, 0.0, 0.0, 0.0], [0.0, 6.0, 0.0, 0.0], [0.0, 0.0, 6.0, 0.0], [0.0, 0.0, 0.0, 6.0]]
2 0 full 8.24789043818501e-09 0 0 0 0 0.166666666666667 0 0 0 0.166666666666667 0 0 0.166666666666667 0 0.166666666666667 0.000771604938271605 [[6.0, 0.0, 0.0, 0.0], [0.0, 6.0, 0.0, 0.0], [0.0, 0.0, 6.0, 0.0], [0.0, 0.0, 0.0, 6.0]]