Qu

normalize

Builtin index · Statistics & ML

result = normalize(X)

Input: X · Output: result

What it is

Min-max scaling of X (a vector, an N-row/D-column matrix scaled column-wise, or a table scaled per numeric column) to [0, 1]: (x - min) / (max - min).

Overloads

One call shape — this function is not overloaded.

CodeInputOutputDescription
result = normalize(X)
X vector or matrixnot documented yet
result —
Returns a value the same shape as X.

Examples

From the documentation, and run by the build -- the output and the figure below are what the engine actually produced. Simplest first.

function normalize(v)
    m = mean(v)
    s = std(v)
    return (v - m) / s
end function

z = normalize(y)
print("normalized: mean {mean(z):.2e}, std {std(z):.4f}")
output
normalized: mean 3.37e-18, std 1.0000

from from-zero

How it works

Feature scaling, one-shot verbs — fit-and-apply in one call, no reuse (see fit_scaler below for the fit-once/reuse-on- new-data path). Mat scales per column (rows = samples, columns = features); Vec/Signal/a plain number scale as a single feature; a Table scales each numeric column, text columns untouched. See scaler's own module doc for the exact per-method formula and the quantile_normalize target- distribution choice. normalize(X) — min-max scaling to [0, 1].

From the note above this builtin in the interpreter, where the reasoning was written down as it was built.