1.0 - 8.00 - GMM Example 2: Basic GMM, Diagonal Covariance, Unpacked Output - 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)

SQL Call

DROP TABLE gmm_output_ex2;

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

Output

Because the SQL call specifies PackOutput (0), the mean for each dimension is output in a separate column.

Output Message Table
property value
Output Table Table Name Specified in OutputTable argument
Algorithm Used Basic GMM
   
Stopping Criterion Iteration limit reached
Delta Log Likelihood 0.004413
Number of Iterations 10
Number of Clusters 3
Covariance Type diagonal
   
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 -288.031
Akaike Information Criterion 628.062 on 26 parameters
Bayesian Information Criterion 700.537 on 26 parameters

This query returns the following table:

SELECT * FROM gmm_output_ex2 ORDER BY cluster_id;
gmm_output_ex2
cluster_id points_assigned covariance_type weight sepal_length sepal_width petal_length petal_width cov_1 cov_2 cov_3 cov_4 determinant prec
0 56 diagonal 0.463728582737372 6.56751643513457 2.99034957312515 5.31297748907166 1.87945392924265 0.328907194931553 0.0789954902732131 0.412726614048047 0.101126958343901 0.00108443891101065 [3.040371312668016, 12.658950486178506, 2.422911355756636, 9.888560047453522]
1 40 diagonal 0.333333333332912 4.99750000238412 3.41750001311301 1.44249999523138 0.252500005066006 0.13174372760081 0.152943747872323 0.0244437555312951 0.011993750630212 5.90724008666195e-06 [7.590494198175791, 6.538351609081782, 40.91024387474792, 83.37675434747011]
2 24 diagonal 0.202938083929716 5.68870509210384 2.60731133573207 4.06718699627474 1.22833926311197 0.183744196287492 0.0867936412267367 0.195533280241609 0.0317389021878551 9.89724055263653e-05 [5.442348766408755, 11.521581372391491, 5.114218913344879, 31.5070758932125]