Stay organized with collectionsSave and categorize content based on your preferences.
The ML.NORMALIZER function
This document describes theML.NORMALIZERfunction, which lets you normalize
an array of numerical expressions using a givenp-norm.
Syntax
ML.NORMALIZER(array_expression [, p])
Arguments
ML.NORMALIZERtakes the following arguments:
array_expression: an array ofnumericalexpressions to normalize.
p: aFLOAT64value 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.NORMALIZERreturns an array ofFLOAT64values that represent the
normalized numerical expressions.
Example
The following example normalizes a set of numerical expressions using a p-norm
of2:
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-29 UTC."],[[["\u003cp\u003e\u003ccode\u003eML.NORMALIZER\u003c/code\u003e is a function used to normalize an array of numerical expressions using a specified p-norm.\u003c/p\u003e\n"],["\u003cp\u003eThe function takes an \u003ccode\u003earray_expression\u003c/code\u003e of numerical values and an optional \u003ccode\u003ep\u003c/code\u003e parameter, which defaults to \u003ccode\u003e2\u003c/code\u003e, to determine the degree of p-norm.\u003c/p\u003e\n"],["\u003cp\u003eThe function returns a new array consisting of \u003ccode\u003eFLOAT64\u003c/code\u003e values representing the normalized numerical expressions.\u003c/p\u003e\n"],["\u003cp\u003eThe p-norm \u003ccode\u003ep\u003c/code\u003e parameter in \u003ccode\u003eML.NORMALIZER\u003c/code\u003e can be \u003ccode\u003e0.0\u003c/code\u003e, any value greater than or equal to \u003ccode\u003e1.0\u003c/code\u003e, or \u003ccode\u003eCAST('+INF' AS FLOAT64)\u003c/code\u003e.\u003c/p\u003e\n"]]],[],null,["# The ML.NORMALIZER function\n==========================\n\nThis document describes the `ML.NORMALIZER` function, which lets you normalize\nan array of numerical expressions using a given\n[p-norm](https://ncatlab.org/nlab/show/p-norm).\n\nSyntax\n------\n\n```sql\nML.NORMALIZER(array_expression [, p])\n```\n\n### Arguments\n\n`ML.NORMALIZER` takes the following arguments:\n\n- `array_expression`: an array of [numerical](/bigquery/docs/reference/standard-sql/data-types#numeric_types) expressions to normalize.\n- `p`: a `FLOAT64` value that specifies the degree of p-norm. This can be `0.0`, any value greater than or equal to `1.0`, or `CAST('+INF' AS FLOAT64)`. The default value is `2`.\n\nOutput\n------\n\n`ML.NORMALIZER` returns an array of `FLOAT64` values that represent the\nnormalized numerical expressions.\n\nExample\n-------\n\nThe following example normalizes a set of numerical expressions using a p-norm\nof `2`: \n\n```sql\nSELECT ML.NORMALIZER([4.0, 1.0, 2.0, 2.0, 0.0]) AS output;\n```\n\nThe output looks similar to the following: \n\n```\n+--------+\n| output |\n+--------+\n| 0.8 |\n| 0.2 |\n| 0.4 |\n| 0.4 |\n| 0.0 |\n+--------+\n```\n\nWhat's next\n-----------\n\n- For information about feature preprocessing, see [Feature preprocessing overview](/bigquery/docs/preprocess-overview).\n- For information about the supported SQL statements and functions for each model type, see [End-to-end user journey for each model](/bigquery/docs/e2e-journey)."]]