featurizer registers 67 aggregations (applied across
backward relationships, parent ← child) and
83 transformers (applied to features within an
entity). This page is generated from the registry at build time, so it
cannot drift from the code. Select primitives per config with the
aggregations: / transformations: keys — see the
configuration reference .
Prefer to browse interactively?
Open the primitives explorer — faceted filter by type and category, live search, and the SQL each primitive emits.
Note
Peer-group features (peer_groups), spatial second-table features
(spatial_relationships), and the φ-bridge companion are planner
passes driven by their own config blocks — deliberately not registry
primitives, so they are not listed here.
Discover the same information from the CLI:
uv run python -m featurizer list-primitives --type agg --show-sql
primitive description SQL example countCount of non-null values COUNT(status)maxMaximum value MAX(amount)meanArithmetic mean (average) AVG(amount)minMinimum value MIN(amount)nuniqueCount of distinct values COUNT(DISTINCT status)stddevStandard deviation STDDEV(amount)sumSum of all values SUM(amount)varianceStatistical variance VARIANCE(amount)
primitive description SQL example allTrue if all values are true (boolean AND) BOOL_AND(is_active)anyTrue if any value is true (boolean OR) BOOL_OR(is_active)
primitive description SQL example kl_driftKL divergence: recent vs prior-window category distribution SUM(p_recent * LN(p_recent / p_baseline)) over shared supportwasserstein_driftQuantile L1 drift: recent vs prior-window numeric distribution |q10_r - q10_b| + |q50_r - q50_b| + |q90_r - q90_b|
primitive description SQL example gap_cvCoefficient of variation of inter-event gaps STDDEV(gap) / NULLIF(AVG(gap), 0)gap_maxMaximum inter-event gap duration MAX(ts - LAG(ts) OVER (ORDER BY ts))gap_meanMean inter-event gap duration AVG(ts - LAG(ts) OVER (ORDER BY ts))gap_minMinimum inter-event gap duration MIN(ts - LAG(ts) OVER (ORDER BY ts))gap_stddevStandard deviation of inter-event gaps STDDEV(ts - LAG(ts) OVER (ORDER BY ts))
primitive description SQL example entropyShannon entropy of categorical distribution -SUM(p * LN(p)) where p = COUNT(val) / SUM(COUNT(val))giniGini coefficient (inequality measure, 0-1) 2 * SUM(rank * val) / (n * SUM(val)) - (n+1)/nhhiHerfindahl-Hirschman Index (concentration measure) SUM(p^2) where p = COUNT(val) / SUM(COUNT(val))theilTheil-T inequality index over positive values AVG((x/mean) * LN(x/mean))
primitive description SQL example geometric_meanGeometric mean (for growth rates) EXP(AVG(LOG(value)))harmonic_meanHarmonic mean (for rates and ratios) COUNT(value) / SUM(1.0/value)trimmed_mean_10Mean of values within the 10th-90th percentile range AVG(x) WHERE x BETWEEN p10 AND p90
primitive description SQL example medianMedian value (50th percentile) PERCENTILE_CONT(0.5) WITHIN GROUP (ORDER BY amount)modeMost frequent value MODE() WITHIN GROUP (ORDER BY status)p1010th percentile PERCENTILE_CONT(0.10) WITHIN GROUP (ORDER BY amount)p2525th percentile (first quartile) PERCENTILE_CONT(0.25) WITHIN GROUP (ORDER BY amount)p7575th percentile (third quartile) PERCENTILE_CONT(0.75) WITHIN GROUP (ORDER BY amount)p9090th percentile PERCENTILE_CONT(0.90) WITHIN GROUP (ORDER BY amount)p9595th percentile PERCENTILE_CONT(0.95) WITHIN GROUP (ORDER BY amount)p9999th percentile PERCENTILE_CONT(0.99) WITHIN GROUP (ORDER BY amount)
primitive description SQL example longest_streakLongest consecutive streak of same value MAX(streak_length) using gaps-and-islandsngram_2_freqBigram frequency distribution of categorical sequences COUNT(DISTINCT val || '->' || LEAD(val)) / COUNT(*)ngram_3_freqTrigram frequency distribution of categorical sequences COUNT(DISTINCT val || '->' || LEAD(val,1) || '->' || LEAD(val,2)) / COUNT(*)sequence_entropyTransition entropy of categorical sequences -SUM(p_ij * LN(p_ij)) over transition matrix
primitive description SQL example bbox_areaApproximate latitude-corrected bounding-box area (m^2) (max(lat)-min(lat))*(max(lon)-min(lon))*cos(avg(lat))*111320^2distance_travelledTotal great-circle distance over consecutive events (m) SUM(haversine(lag(lat,lon), (lat,lon)))radius_of_gyrationRMS great-circle distance of events from their centroid (m) sqrt(AVG(haversine(centroid, point)^2))spatial_stdDegree-space dispersion: sqrt(var(lat) + var(lon)) sqrt(var_samp(lat) + var_samp(lon))
primitive description SQL example markov_conditional_entropyFirst-order Markov entropy rate H(X_t | X_{t-1}) in nats -SUM(p(i,j) * LN(p(j|i))) over the transition matrixmax_transition_probPredictability: largest conditional transition probability MAX(freq / row_total) over the transition matrixrecurrence_intervalMean days between consecutive occurrences of the same state AVG(ts - LAG(ts) OVER (PARTITION BY value ORDER BY ts))rework_countCount of consecutive repeats (self-loops, prev == curr) count(*) WHERE prev = currstate_volatilityCount of categorical value changes over time count(*) WHERE prev IS DISTINCT FROM currtime_in_current_stateDays since the most recent change of a categorical attribute aod.as_of_date - max(ts WHERE value changed)transition_matrix_summaryNumber of distinct observed (prev -> curr) transitions count(DISTINCT (prev, curr))
primitive description SQL example cvCoefficient of variation (STDDEV / MEAN) STDDEV(amount) / NULLIF(AVG(amount), 0)iqrInterquartile range (P75 - P25) PERCENTILE_CONT(0.75) WITHIN GROUP (ORDER BY amount) - PERCENTILE_CONT(0.25) WITHIN GROUP (ORDER BY amount)kurtosisMeasure of distribution tailedness ((value - AVG(value)) / STDDEV(value))^4mean_deviationAverage absolute deviation from the mean (two-pass subquery) AVG(ABS(value - (SELECT AVG(value) ...)))median_absolute_deviationRobust spread: median(|x - median(x)|) percentile_cont(0.5) WITHIN GROUP (ORDER BY abs(x - median))rangeRange (MAX - MIN) MAX(amount) - MIN(amount)skewnessMeasure of distribution asymmetry ((value - AVG(value)) / STDDEV(value))^3variance_ratioVariance ratio: var(value) / var(first difference) var_samp(x) / NULLIF(var_samp(x - LAG(x)), 0)
primitive description SQL example cross_type_latencyMean seconds from an A-typed event to the next B-typed event AVG(MIN(b.ts) - a.ts) for a=A-rows, b=next B-rowsfirst_passage_timeDays from the first event to the first ‘target’ state (else NULL) MIN(ts) FILTER (WHERE col = 'target') - MIN(ts)right_censoring_indicator1 if the terminal event has not occurred by t0 (censored) (count(*) FILTER (WHERE col = 'terminal') = 0)::int
primitive description SQL example age_in_systemAlias of tenure: days since the first observed event aod.as_of_date - min(event_ts)event_rateEvents per unit time COUNT(*) / EXTRACT(EPOCH FROM MAX(ts) - MIN(ts))inter_event_hazard_proxyEvents per day over the observed lifespan (count / tenure) count(*) / (aod.as_of_date - min(event_ts))recencyDays since the most recent event (aod - max event ts) aod.as_of_date - max(event_ts)tenureDays since the first observed event (age in system) aod.as_of_date - min(event_ts)time_spanTime span between first and last event EXTRACT(EPOCH FROM MAX(ts) - MIN(ts))
primitive description SQL example acf_1Lag-1 autocorrelation: corr(x_t, x_{t-1}) corr(x, LAG(x,1) OVER (ORDER BY ts))burstinessGoh-Barabasi burstiness index (-1 to 1) (STDDEV(gap) - AVG(gap)) / NULLIF(STDDEV(gap) + AVG(gap), 0)cosinor_amplitude_weeklyWeekly cosinor amplitude (sin/cos regression approximation) sqrt(regr_slope(x,sin)^2 + regr_slope(x,cos)^2)
primitive description SQL example identityPass-through (no transformation) column_name
primitive description SQL example daily_binBin days into weekday/weekend CASE WHEN dow < 6 THEN 'weekday' ELSE 'weekend' ENDhourly_binBin hours into time-of-day categories CASE WHEN hour < 5 THEN 'night' ... END
primitive description SQL example in_arrayCheck if value is in array value = ANY(ARRAY[...])is_nullCheck if value is null (value IS NULL)
primitive description SQL example cusumCUSUM: cumulative sum of deviations from target mean SUM(value - target_mean) OVER (PARTITION BY id ORDER BY date)mean_shift_ratio_14Ratio of recent 14-period mean to overall mean (change-point detection) AVG(value) OVER (... ROWS 13 PRECEDING) / NULLIF(AVG(value) OVER (), 0)mean_shift_ratio_7Ratio of recent 7-period mean to overall mean (change-point detection) AVG(value) OVER (... ROWS 6 PRECEDING) / NULLIF(AVG(value) OVER (), 0)
primitive description SQL example cum_countCumulative count over time COUNT(value) OVER (PARTITION BY id ORDER BY date)cum_maxCumulative maximum over time MAX(value) OVER (PARTITION BY id ORDER BY date)cum_meanCumulative mean over time AVG(value) OVER (PARTITION BY id ORDER BY date)cum_minCumulative minimum over time MIN(value) OVER (PARTITION BY id ORDER BY date)cum_sumCumulative sum over time SUM(value) OVER (PARTITION BY id ORDER BY date)cumprodRunning product via log-sum-exp (positive series only) exp(sum(ln(value)) OVER (PARTITION BY id ORDER BY date))
primitive description SQL example cyclic_dayDay of week as sin/cos pair for cyclical encoding SIN(dow * 2*PI/7), COS(dow * 2*PI/7)cyclic_hourHour as sin/cos pair for cyclical encoding SIN(hour * 2*PI/24), COS(hour * 2*PI/24)cyclic_monthMonth as sin/cos pair for cyclical encoding SIN((month-1) * 2*PI/12), COS((month-1) * 2*PI/12)
primitive description SQL example centuryCentury number TO_CHAR(date, 'CC')dayDay of month (1-31) TO_CHAR(date, 'DD')domDay of month (DD format) TO_CHAR(date, 'DD')dowISO day of week (1=Monday to 7=Sunday) TO_CHAR(date, 'ID')doyDay of year (1-366) TO_CHAR(date, 'DDD')hourHour (0-23) TO_CHAR(date, 'HH24')monthMonth number (1-12) TO_CHAR(date, 'MM')quarterQuarter of year (1-4) TO_CHAR(date, 'Q')tzTime zone abbreviation TO_CHAR(date, 'TZ')tz_offsetTime zone offset TO_CHAR(date, 'OF')weekWeek of month TO_CHAR(date, 'W')week_of_yearWeek of year (1-53) TO_CHAR(date, 'WW')yearFour-digit year TO_CHAR(date, 'YYYY')
primitive description SQL example cdfCumulative distribution function value CUME_DIST() OVER (PARTITION BY id ORDER BY value)ntileDivide into N equal groups (default: 5) NTILE(5) OVER (PARTITION BY id ORDER BY value)percent_rankRelative rank as percentage (0-1) PERCENT_RANK() OVER (PARTITION BY id ORDER BY value)
primitive description SQL example ema_1414-period exponential moving average SUM(value * EXP(decay * t)) / SUM(EXP(decay * t)) OVER (...)ema_77-period exponential moving average SUM(value * EXP(decay * t)) / SUM(EXP(decay * t)) OVER (...)
primitive description SQL example holt_winters_level_1414-period Holt-Winters level AVG(value) OVER (... ROWS BETWEEN 13 PRECEDING AND CURRENT ROW)holt_winters_level_77-period Holt-Winters level (smoothed average) AVG(value) OVER (... ROWS BETWEEN 6 PRECEDING AND CURRENT ROW)holt_winters_trend_1414-period Holt-Winters trend REGR_SLOPE(value, time) OVER (...)holt_winters_trend_77-period Holt-Winters trend (slope) REGR_SLOPE(value, time) OVER (...)
primitive description SQL example lag_1Value from 1 period ago LAG(value, 1) OVER (PARTITION BY id ORDER BY date)lag_3Value from 3 periods ago LAG(value, 3) OVER (PARTITION BY id ORDER BY date)lag_7Value from 7 periods ago LAG(value, 7) OVER (PARTITION BY id ORDER BY date)
primitive description SQL example absAbsolute value ABS(value)cbrtCube root CBRT(value)ceilRound up to nearest integer CEIL(value)expExponential (e^x) EXP(value)floorRound down to nearest integer FLOOR(value)lnNatural logarithm LN(value)logBase-10 logarithm LOG(value)signSign of value (-1, 0, or 1) SIGN(value)sqrtSquare root SQRT(value)truncTruncate decimal portion TRUNC(value)
primitive description SQL example pct_change_1Percentage change from 1 period ago (value - LAG(value, 1)) / LAG(value, 1)pct_change_3Percentage change from 3 periods ago (value - LAG(value, 3)) / LAG(value, 3)
primitive description SQL example cross_entity_percentilePercentile rank across all entities in the population PERCENT_RANK() OVER (ORDER BY value)cross_entity_zscoreZ-score normalized across all entities in the population (value - AVG(value) OVER ()) / NULLIF(STDDEV(value) OVER (), 0)
primitive description SQL example rolling_iqr_1414-period rolling interquartile range PERCENTILE_CONT(0.75) - PERCENTILE_CONT(0.25) OVER (...)rolling_iqr_77-period rolling interquartile range (P75 - P25) PERCENTILE_CONT(0.75) - PERCENTILE_CONT(0.25) OVER (...)rolling_mean_1414-period rolling mean AVG(value) OVER (... ROWS BETWEEN 13 PRECEDING AND CURRENT ROW)rolling_mean_33-period rolling mean AVG(value) OVER (... ROWS BETWEEN 2 PRECEDING AND CURRENT ROW)rolling_mean_77-period rolling mean AVG(value) OVER (... ROWS BETWEEN 6 PRECEDING AND CURRENT ROW)rolling_median_55-period rolling median PERCENTILE_CONT(0.5) WITHIN GROUP (ORDER BY value) OVER (...)rolling_median_77-period rolling median PERCENTILE_CONT(0.5) WITHIN GROUP (ORDER BY value) OVER (...)rolling_std_1414-period rolling standard deviation STDDEV(value) OVER (... ROWS BETWEEN 13 PRECEDING AND CURRENT ROW)rolling_std_33-period rolling standard deviation STDDEV(value) OVER (... ROWS BETWEEN 2 PRECEDING AND CURRENT ROW)rolling_std_77-period rolling standard deviation STDDEV(value) OVER (... ROWS BETWEEN 6 PRECEDING AND CURRENT ROW)
primitive description SQL example avg_word_lengthMean characters per word non_space_chars::numeric / nullif(num_words, 0)caps_ratioUppercase letters / all letters upper_letters::numeric / nullif(all_letters, 0)digit_ratioDigits / all characters digit_chars::numeric / nullif(length(text), 0)exclamation_countCount of ’!’ characters length(text) - length(replace(text, '!', ''))num_charsCharacter count in text CHAR_LENGTH(text)num_sentencesSentence-terminator count (. ! ?) length(text) - length(regexp_replace(text, '[.!?]', '', 'g'))num_wordsWhitespace-delimited word count (SELECT count(*) FROM regexp_split_to_table(text, '\s+') t(w) WHERE w <> '')punct_ratioPunctuation / all characters punct_chars::numeric / nullif(length(text), 0)question_countCount of ’?’ characters length(text) - length(replace(text, '?', ''))unique_word_ratioDistinct words / total words (type-token ratio) distinct_words::numeric / nullif(num_words, 0)
primitive description SQL example diffDifference from previous value value - LAG(value) OVER (...)diff2Second difference (acceleration): x - 2*lag1 + lag2 value - 2*LAG(value,1) OVER w + LAG(value,2) OVER wdiff3Third difference (jerk): x - 3lag1 + 3 lag2 - lag3 value - 3*LAG(value,1) + 3*LAG(value,2) - LAG(value,3) OVER wfirstFirst value in partition FIRST_VALUE(value) OVER (PARTITION BY id ORDER BY date)lastLast value in partition LAST_VALUE(value) OVER (PARTITION BY id ORDER BY date)previousPrevious row’s value LAG(value) OVER (PARTITION BY id ORDER BY date)time_since_previousTime elapsed since previous record date - LAG(date) OVER (...)