Stay organized with collections
Save and categorize content based on your preferences.
The ML.MAX_ABS_SCALER function
This document describes the ML.MAX_ABS_SCALER function, which lets you
scale a numerical expression to the range
[-1, 1] by dividing with the maximum absolute value. It doesn't
shift or center the data, and so doesn't destroy any sparsity.
When used in the
TRANSFORM clause,
the maximum absolute value calculated during training is automatically
used in prediction.
Syntax
ML.MAX_ABS_SCALER(numerical_expression) OVER()
Arguments
ML.MAX_ABS_SCALER takes the following argument:
numerical_expression: the
numerical
expression to scale.
Output
ML.MAX_ABS_SCALER returns a FLOAT64 value that represents the scaled
numerical expression.
Example
The following example scales a set of numerical expressions to have values
between -1 and 1:
[[["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-03-05 UTC."],[[["The `ML.MAX_ABS_SCALER` function scales a numerical expression to the range `[-1, 1]` by dividing it by its maximum absolute value."],["This function does not shift or center the data, preserving any sparsity present in the dataset."],["When used within the `TRANSFORM` clause, the maximum absolute value determined during the training phase is applied automatically during the prediction phase."],["The function takes a single numerical expression as an argument and returns a scaled `FLOAT64` value."],["In practice, the function will adjust numbers to be between -1 and 1, with the maximum and minimum values of the input data mapped to those values, respectively."]]],[]]