Histogram Example 4: CustomBinTable - 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ā„¢

Input

bin_breaks
break
50.0
100.0
150.0
200.0
250.0
300.0
350.0

SQL Call

SELECT * FROM Histogram (
  ON cars_hist AS InputTable
  ON bin_breaks AS CustomBinTable
  OUT TABLE outputtable (cars_hist_out2)
  USING
  CustomBinColumn ('break')
  TargetColumn ('hp')
  GroupByColumns ('cyl')
)as dt;

Output

output_table output_column
specified in OutputTable argument "cyl" bin bin_start bin_end bin_count bin_percent

This query returns the following table:

SELECT * FROM cars_hist_out2;
cyl bin bin_start bin_end bin_count bin_percent
6 0 50 100 0 0.00
6 1 100 150 6 85.71
6 2 150 200 1 14.29
6 3 200 250 0 0.00
6 4 250 100 0 0.00
6 5 300 350 0 0.00
8 0 50 100 0 0.00
8 1 100 150 0 0.00
8 2 150 200 7 50.00
8 3 200 250 5 35.71
8 4 250 100 1 7.14
8 5 300 350 1 7.14
4 0 50 100 9 81.82
4 1 100 150 2 18.18
4 2 150 200 0 0.00
4 3 200 250 0 0.00
4 4 250 100 0 0.00
4 5 300 350 0 0.00