Skip to main content

Module observe

Module observe 

Source
Expand description

Feedback observations and the persistent observation log.

All three feedback modalities condition the same latent utility (the reference: One utility, three likelihoods). An observation stores the raw feature vector(s) it was made about, the names of those coordinates, a schema version, and which session produced it (sessions carry their own keep/kill threshold latent τ and, at K > 1, a style latent z).

§Why raw φ and not standardized φ

Standardization is a modeling choice, not a fact about what the user did. Baking it into the log made the log stop being the source of truth in two ways. Because the standardizer was fit once and frozen, z-scores drifted as the pool moved away from that reference sample — the linear model ended up extrapolating far outside where it was calibrated. And, structurally worse, the feature set could never change again: adding a coordinate, or fixing one’s units, silently invalidated every saved profile with no way to detect it.

Storing raw values plus names fixes both. The standardizer is re-fit at fit time over the log and the live pool, and a log recorded under an older feature set is re-projected by name onto the current one (FitSet::build) — coordinates that disappeared are dropped, ones that did not exist yet are imputed at the standardizer mean, which is exactly “no evidence” in standardized space.

The names ride on every observation rather than once per log. They duplicate, but a log is a stream of independently-meaningful records: a record that cannot be interpreted without a header elsewhere in the file is the failure mode this whole change exists to prevent.

Structs§

FitSet
A log projected onto one feature order and standardized — exactly what the likelihood sees. Derived at fit time from the log plus a standardizer, and never persisted: the log is the source of truth, this is a view of it.
Observation
One feedback event: what happened, in which session, over which features.
ObservationLog
The append-only feedback log for one taste profile.

Enums§

Feedback
What the user did, and the feature vector(s) it was about.
Provenance
How a preference was collected — not what it was.

Constants§

PHI_SCHEMA
Current φ schema: vectors are raw (un-standardized) and carry names.
PHI_SCHEMA_STANDARDIZED
Schema of logs written before raw-φ logging: vectors are standardized under the profile’s persisted standardizer, and carry no names.