The ML.NORMALIZER function
Stay organized with collections
Save and categorize content based on your preferences.
This document describes the ML.NORMALIZER
function, which lets you normalize
an array of numerical expressions using a given
p-norm.
Syntax
ML.NORMALIZER(array_expression [, p])
Arguments
ML.NORMALIZER
takes the following arguments:
array_expression
: an array of numerical expressions to normalize.p
: aFLOAT64
value that specifies the degree of p-norm. This can be0.0
, any value greater than or equal to1.0
, orCAST('+INF' AS FLOAT64)
. The default value is2
.
Output
ML.NORMALIZER
returns an array of FLOAT64
values that represent the
normalized numerical expressions.
Example
The following example normalizes a set of numerical expressions using a p-norm
of 2
:
SELECT ML.NORMALIZER([4.0, 1.0, 2.0, 2.0, 0.0]) AS output;
The output looks similar to the following:
+--------+ | output | +--------+ | 0.8 | | 0.2 | | 0.4 | | 0.4 | | 0.0 | +--------+
What's next
- For information about feature preprocessing, see Feature preprocessing overview.
- For information about the supported SQL statements and functions for each model type, see End-to-end user journey for each model.