The following example assumes the sparse input format for InputTable:
create multiset table scale_input_sparse (passenger int, attribute_column varchar(20), attribute_value real); insert into scale_input_sparse values (97, 'age', 71); insert into scale_input_sparse values (97, 'fare', 34.6542); insert into scale_input_sparse values (488, 'age', 58); insert into scale_input_sparse values (488, 'fare', 29.7); insert into scale_input_sparse values (505, 'age', 16); insert into scale_input_sparse values (505, 'fare', 86.5); insert into scale_input_sparse values (631, 'age', 80); insert into scale_input_sparse values (631, 'fare', 30); insert into scale_input_sparse values (873, 'age', 33); insert into scale_input_sparse values (873, 'fare', 5);
TD_ScaleFit Call
SELECT * FROM TD_ScaleFit( ON scale_input_sparse AS InputTable OUT PERMANENT TABLE OutputTable(sparseScaleFitOut) USING TargetAttributes('fare') AttributeNameColumn('attribute_column') AttributeValueColumn('attribute_value') MissValue('Keep') ScaleMethod('range') GlobalScale('f') )AS dt2;
TD_ScaleFit Output
TD_STATTYPE_SCLFIT attribute_column attribute_value avg fare 3.71708400000000E 001 count fare 5.00000000000000E 000 globalscale_false fare NULL intercept fare 0.00000000000000E 000 location fare 5.00000000000000E 000 max fare 8.65000000000000E 001 min fare 5.00000000000000E 000 missvalue_KEEP fare NULL multiplier fare 1.00000000000000E 000 null fare 0.00000000000000E 000 scale fare 8.15000000000000E 001 ScaleMethodNumberMapping: [0:mean,1:sum,2:ustd,3:std,4:range,5:midrange,6:maxabs,7:rescale] fare 4.00000000000000E 000 sum fare 1.85854200000000E 002