1.1 - 8.10 - GMM Example: Basic GMM, Spherical Covariance, Packed 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.

SQL Call

SELECT * FROM GMM (
  ON (SELECT 1) AS InitialValues PARTITION BY 1
  ON gmm_iris_train AS InputTable
  OUT TABLE OutputTable (gmm_output_ex1)
  USING
  ClusterNum (3)
  CovarianceType ('spherical')
  MaxIterNum (10)
  PackOutput (1)
) AS dt ;

Output

Because the SQL call specifies PackOutput (1), a single mean column displays a vector containing the mean value for each dimension.

property			value
-----------------------------  -------------------------------------------------------------------------------------------------------------
Output Table			Table Name Specified in OutputTable argument
Algorithm Used			Basic GMM
	
Stopping Criterion		Algorithm converged with tolerance 0.001
Delta Log Likelihood		0
Number of Iterations		5
Number of Clusters		3
Covariance Type	spherical
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			-332.722
Akaike Information Criterion	699.444 on 17 parameters
Bayesian Information Criterion	746.831 on 17 parameters
SELECT * FROM gmm_output_ex1;
cluster_id	points_assigned	covariance_type	weight		mean										covariance	log_determinant		prec
0		1		spherical	8.33E-03	[4.5, 2.3, 1.3, 0.3]								1.00E-12	-1.10524084463714E 002	1.00E+12
1		39		spherical	3.25E-01	[5.01025640674348, 3.4461538411338686, 1.446153846741701, 0.25128205118815566]	0.072353714	-1.05047539703453E 001	13.82099057
2		80		spherical	6.67E-01	[6.299999998810369, 2.873750003735264, 4.933749991865624, 1.6812499968280563]	0.351423837	-4.18304908500248E 000	2.845566791

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