name: op-attr-normalized
description: Per-row min-max normalized value — (value − min) / (max − min) ∈ [0, 1].
kind: operator
category: ATTR
operator: ATTR_NORMALIZED
type: reference
applies_to: process, compose, predict
examples_tags: [feature-engineering, buffered-pipeline]
Use when
Rescales a numeric field to 0 to 1 on every row: 0 is the smallest value, 1 the largest.
Questions it answers:
- How can fields on very different scales be put on one 0-to-1 scale before combining them?
- Where does each row’s value sit between the lowest and highest seen?
Use something else:
ATTR_PERCENTILEwhen the field has extreme values that would squeeze the rest of the range.
Params
None.
Inputs
field — admitted types: see ## Contract; decimal128 reads as its float64 echo, packed_bool as 0/1.
label— derived field name; default<TYPE>_<field>
Output
One float64 per record in [0, 1]. Null source → null (counted in n_null), left out of min / max.
Reading the output
value: Where the row’s value sits between the smallest and largest value, on a 0-to-1 scale: (value - min) / (max - min). 0 is the minimum, 1 the maximum and 0.5 halfway between them, which is not the median.- Caveat: One extreme value sets the minimum or maximum and squeezes every other row into a narrow part of the scale; ATTR_PERCENTILE is not affected that way.
- Caveat: A row with a missing value gets no value (null) and is left out of the minimum and maximum; every row reads null when all values are equal (max = min: 0/0, undefined).
Contract
- Types (
field):date,datetime,decimal128,f32,f64,packed_bool,u16,u32,u4,u64,u8; any other scalar type isPULSE_FIELD_TYPE_UNSUPPORTED. - Weight: no weighted form; an explicit weight is
PROCESSING_CONFIG, an instance default is skipped. - Streaming: streamable.
Gotchas
- A min-max rescale has no weighted meaning.
- Two-pass: pre-pass tracks min/max across filter-passing rows; pass 2 emits per row.
- Constant field (
max == min, or one non-null row) →nullper row (0/0), counted inn_null; the run warnsPULSE_ATTR_ZERO_SPREAD(detailsn,spread: range,reasonconstant/single_value) — under--strictit fails with that code. Runtime only: predict cannot see the data. - Outlier-sensitive — one extreme value compresses the rest of the range.
- Feeds a downstream formula: a LATER formula attribute reads its label; materialise it (
derived-cohorts) for a later request.
See
pulse_examples_search tags=[feature-engineering]- Skills:
attribute-composition,op-attr-zscore,op-attr-percentile