ScaleByPartition Example - 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™

This example scales the sequences in each partition independently.

Input

SQL Call

SELECT * FROM ScaleByPartition (
  ON scale_housing PARTITION BY types
  USING
  TargetColumns ('[2:6]')
  ScaleMethod ('maxabs')
  Accumulate ('types', 'id')
) AS dt ORDER BY 1 desc,2;

Output

types id price lotsize bedrooms bathrms stories
classic 1 0.688524590163934 0.879699248120301 1 1 1
classic 2   0.601503759398496 0.666666666666667 1 0.5
classic 3 0.811475409836066 0.46015037593985 1 1 0.5
classic 4 0.991803278688525 1 1 1 1
classic 5 1 0.956390977443609 0.666666666666667 1 0.5
bungalow 6 0.745762711864407 0.756363636363636 1 0.5 0.25
bungalow 7 0.745762711864407 0.705454545454545   1 0.5
bungalow 8 0.779661016949153 0.756363636363636 1 0.5 0.75
bungalow 9 0.946892655367232 0.872727272727273 1 0.5 0.25
bungalow 10 1 1 1 1 1