This example scales the sequences in each partition independently.
Input
- scale_housing, as in Scale Example 1: ScaleMethod ('midrange'), which is partitioned by the column types
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 |