APPLY_NORMALIZE

Applies the normalization parameters saved in a model to a set of specified columns in the input table or view. If any column specified in the function is not contained in the model, the data will pass through unchanged to APPLY_NORMALIZE.

Important: Before using a machine learning function, be aware that all the ongoing transactions might be committed.

Syntax

APPLY_NORMALIZE ( col1,col2 ..., coln
	           USING PARAMETERS model_name='model_name');
 

Arguments

col1, col2 ..., coln

The columns to use from the input table or view.

Parameters

 
model_name

The name of the model. Model names are case-insensitive. Value must be VARCHAR.

Privileges

To use APPLY_NORMALIZE, you must either be a superuser or have CREATE privileges for the schema of the output view and SELECT privileges for the input table or view. There are no privileges needed on the function itself.

See GRANT (Schema) and GRANT (Table).

Examples

This example shows how you can use the APPLY_NORMALIZE function on the hp and cyl columns in the mtcars table, where hp is in the normalization model and cyl is not in the normalization model.

=> SELECT APPLY_NORMALIZE (hp, cyl USING PARAMETERS model_name = 'mtcars_normfit') FROM mtcars;
hp        	    | cyl
-------------------+-----
0.62897527217865   |   8
0.681978821754456  |   8
                0  |   4
0.434628963470459  |   8
0.575971722602844  |   8
                1  |   8
0.204946994781494  |   6
0.204946994781494  |   6
0.201413422822952  |   4
0.681978821754456  |   8
0.434628963470459  |   6
0.0494699664413929 |   4
0.0494699664413929 |   4
0.749116599559784  |   8
0.0353356897830963 |   4
0.452296823263168  |   8
0.159010604023933  |   4
0.346289753913879  |   8
0.54063606262207   |   8
0.144876331090927  |   4
0.346289753913879  |   8
0.204946994781494  |   6
0.215547695755959  |   4
0.15194346010685   |   4
0.250883400440216  |   6
0.250883400440216  |   6
0.452296823263168  |   8
0.452296823263168  |   8
0.434628963470459  |   8
0.137809187173843  |   4
0.045936394482851  |   4
0.187279149889946  |   6
(32 rows)

See Also