Upgrading
Upgrade in two steps: install the new release, then run triage db upgrade
against each project database before its first run.
The first run after any upgrade builds features, matrices and models again. triage-pg’s own version is part of every artifact’s identity, and so is the featurizer version, so nothing the old release built is reused. Later runs reuse what the first run built. Compare the new models with the old ones before you replace a model in production.
The sections below list what else changes, newest release first.
v1.6.7: missing-value flags are features; the target history is stored once per date
Section titled “v1.6.7: missing-value flags are features; the target history is stored once per date”Missing-value flags reach the model. Every imputation rule except
zero_noflag, null_category and error now adds a <feature>__missing
column (1 where the value was missing, else 0) beside the imputed feature, and
models train on it. The list of flags comes from the imputation policy, not
from the data, so a flag column is present (all 0) even in a matrix where no
value was missing; one model group therefore keeps one feature list across
splits. Before, zero and zero_noflag built the same matrix. Matrices are
wider by one column per flagged feature, and model scores change. A flag
belongs to its base feature’s feature group.
The target-history series is stored once per as_of_date. With a
history_query, triage-pg runs the query once for each date and every matrix
that holds the date reads the stored series (see the
FAQ).
On the DirtyDuck regression tutorial the query runs 5 times instead of 14, and
every matrix is the same as before. triage db upgrade adds the
target_history artifact kind.
v1.6.6: features are computed once per as_of_date
Section titled “v1.6.6: features are computed once per as_of_date”From v1.6.6, triage-pg stores each date’s features once and every matrix
that holds that date reads them (see the FAQ).
The matrix’s identity now names those stored features. No feature changes name
or value. The rows of a matrix
are now sorted by as_of_date and entity_id.
v1.6.5: featurizer v1.6.0 reads the feature query in batches
Section titled “v1.6.5: featurizer v1.6.0 reads the feature query in batches”triage-pg v1.6.5 runs on featurizer v1.6.0. No feature changes name or value. featurizer v1.6.0 changes only how it reads the feature query: it runs the query once instead of twice, and it decodes the result in bounded batches. Before, featurizer held the whole decoded result in memory at once, so its peak memory grew with rows × columns. A matrix of millions of rows and hundreds of columns could exhaust the machine’s memory. On the DirtyDuck tutorial, the eight matrices and every evaluation came out identical on both versions, and featurizer took 1.9 s in place of 3.5 s.
v1.6.0: the target history is placed on the calendar
Section titled “v1.6.0: the target history is placed on the calendar”A config with a history_query needs the history_period key (for example
'1 month'); without it the config is refused at the start of the run. The
predictions of the time-series baselines change where an entity’s history had
gaps. The FAQ entry on missing history periods
explains the gaps and how to fill them.
v1.5.0: featurizer v1.5.0 changes some feature values
Section titled “v1.5.0: featurizer v1.5.0 changes some feature values”triage-pg v1.5.0 runs on featurizer v1.5.0, which changes the values of some columns and keeps every column name. Three groups of columns move:
- The sequence primitives (
sequence_entropy,markov_conditional_entropy,max_transition_prob,state_volatility,transition_matrix_summary,rework_count,ngram_2_freq,ngram_3_freq,time_in_current_state). A NULL category now counts as a state, so a step into or out of a NULL is a transition.ngram_3_freqon a series of two rows is now NULL. - The interval columns of
skewness,kurtosis,harmonic_meanandgeometric_mean. Before, each|interval=…column repeated the whole-history value. Now each one reads only its window. - Interval columns with a
timestampas-of date, or an interval with a time part such asPT12H. A window now ends at the as-of instant. With adateas-of date and intervals of whole days, weeks, months or years, nothing moves.
One change is triage-pg’s own. The target’s identifier columns other than its
id are no longer features: the key of a relationship the target is a parent of
(a site_id on a person target), an index variable, and its spatial index.
They were reaching the matrix as numbers, so a model could read a surrogate key
as an ordinal. A matrix of such a target now has those columns fewer, and its
width equals the feature count that triage analyze-config prints. To
keep one as a feature, declare it under the target’s variables:.
v1.3.1: window features on undated entities are gone
Section titled “v1.3.1: window features on undated entities are gone”featurizer v1.3.1 stops emitting window features on an entity without a
temporal_ix: cum_sum, cum_mean, cum_max, cum_min, cum_count,
first, last, previous, cdf, percent_rank and ntile. Two cases lose
columns:
- An undated target. The target holds one row per id under each as-of date,
so
CUM_SUM(<target>.X)equalledX. The dropped columns were copies, and no remaining column changes value. DirtyDuck goes from 147 to 107 columns, all 40 of themCUM_SUM(facilities.…). - An undated child whose
idseveral rows share.last,first,previousandntiledepended on the order PostgreSQL read the rows in. Retrain a model that used one of them.
To keep a window feature, give the entity a temporal_ix.
v1.3.0: precision@k counts the labeled rows inside the cut
Section titled “v1.3.0: precision@k counts the labeled rows inside the cut”Since v1.3.0 triage-pg computes threshold metrics the way DSSG triage did:
rank every scored row, cut at k, then count only the labeled rows inside the
cut. Before v1.3.0 it dropped the unlabeled rows first, so precision@100_abs
meant “the top 100 among labeled entities”. When every test row is labeled the
two agree. When labels are selective (an inspection nobody made), they do not,
and triage db upgrade recomputes the stored values.