Correlation Example: Omit PARTITION BY - Teradata Vantage

Machine Learning Engine Analytic Function Reference

Product
Teradata Vantage
Release Number
8.10
1.1
Published
October 2019
Language
English (United States)
Last Update
2019-12-31
dita:mapPath
ima1540829771750.ditamap
dita:ditavalPath
jsj1481748799576.ditaval
dita:id
B700-4003
lifecycle
previous
Product Category
Teradata Vantageā„¢

This example omits the PARTITION BY clause, so the function determines the correlation values for the overall population and does not group the data by state.

SQL Call

SELECT * FROM CorrelationReduce (
  ON CorrelationMap (
    ON corr_input 
    USING
    TargetColumns ('[2:3]','employed:gdp','employed:unemployed','employed:armedforces')
    KeyName ('keys')
  ) PARTITION BY keys
) AS dt;

Output

corr_item1  corr_item2  value_col
----------- ----------- ------------------
gdpdeflator gdp         1.0
armedforces employed    0.4573073983192444
unemployed  employed    0.5024980902671814
gdp         employed    0.9835516214370728
gdp         gdp         1.0
gdpdeflator gdpdeflator 1.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.