1.1 - 8.10 - GMM Example: DP-GMM, Full Covariance, Unpacked Output - Teradata Vantage

Teradata Vantage™ - Machine Learning Engine Analytic Function Reference

Product
Teradata Vantage
Release Number
1.1
8.10
Release Date
October 2019
Content Type
Programming Reference
Publication ID
B700-4003-079K
Language
English (United States)

Input

See GMM Examples Input.

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 InitialValues 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

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
SELECT * FROM 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        log_determinant prec
----------- --------------- --------------- ---------------------- ---------------------- ---------------------- ---------------------- ---------------------- ---------------------- ---------------------- ---------------------- ---------------------- ---------------------- ---------------------- ---------------------- ---------------------- ---------------------- ---------------------- ---------------------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
          0             120 full             9.99991735613739E-001  5.73419321840163E 000  3.01843398222490E 000  3.61166171552218E 000  1.14486231793446E 000  1.66229691309346E 000 -2.14185076572784E-001  1.69427437178447E 000  6.93859028192593E-001  1.14410673681517E 000  2.62470215164859E-002  1.96024408024593E-002  4.00032159904576E 000  1.27929542158923E 000  1.50738876901989E 000  1.88394523840622E 000 [[0.7824065708713632, -0.04166720450521028, -0.2990852151033951, -0.10577545815433718], [-0.09328115290486803, 0.875436053888177, 0.03258314726425615, 0.0039006629777845513], [-0.169999622325278, 0.13304206449205377, 0.40094413849390415, -0.26375291186527555], [-0.04690499623137513, 0.04519483374938999, -0.25244627156275695, 0.898648652091002]]
          1               0 full             8.25613837088043E-006  0.00000000000000E 000  0.00000000000000E 000  0.00000000000000E 000  0.00000000000000E 000  1.66666666666667E-001  0.00000000000000E 000  0.00000000000000E 000  0.00000000000000E 000  1.66666666666667E-001  0.00000000000000E 000  0.00000000000000E 000  1.66666666666667E-001  0.00000000000000E 000  1.66666666666667E-001 -7.16703787691222E 000 [[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-009  0.00000000000000E 000  0.00000000000000E 000  0.00000000000000E 000  0.00000000000000E 000  1.66666666666667E-001  0.00000000000000E 000  0.00000000000000E 000  0.00000000000000E 000  1.66666666666667E-001  0.00000000000000E 000  0.00000000000000E 000  1.66666666666667E-001  0.00000000000000E 000  1.66666666666667E-001 -7.16703787691222E 000 [[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]]

Download a zip file of all examples and a SQL script file that creates their input tables from the attachment in the left sidebar.