The ML.NORMALIZER function

This document describes theML.NORMALIZER function, which lets you normalizean array of numerical expressions using a givenp-norm.

You can use this function with models that supportmanual feature preprocessing. For moreinformation, see the following documents:

Syntax

ML.NORMALIZER(array_expression [, p])

Arguments

ML.NORMALIZER takes the following arguments:

  • array_expression: an array ofnumericalexpressions to normalize.
  • p: aFLOAT64 value that specifies the degree of p-norm. Thiscan be0.0, any value greater than or equal to1.0, orCAST('+INF' AS FLOAT64). The default value is2.

Output

ML.NORMALIZER returns an array ofFLOAT64 values that represent thenormalized numerical expressions.

Example

The following example normalizes a set of numerical expressions using a p-normof2:

SELECTML.NORMALIZER([4.0,1.0,2.0,2.0,0.0])ASoutput;

The output looks similar to the following:

+--------+| output |+--------+| 0.8    || 0.2    || 0.4    || 0.4    || 0.0    |+--------+

What's next

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-12-15 UTC.