pub struct ObservationLog {
pub observations: Vec<Observation>,
}Expand description
The append-only feedback log for one taste profile.
Fields§
§observations: Vec<Observation>The observations, in arrival order.
Read row by row, and a row that will not parse is skipped rather
than failing the log. That is a one-line attribute standing in for a
very large failure: this Vec is nested inside Profile, which is
nested inside SessionState, so a single unreadable cell anywhere in
the log used to abort the whole deserialize — and the caller’s only
recovery is to start a new session. Losing one vote is a rounding
error; losing the bank, the lineage, the pins and every vote because of
it is the exact opposite of the promise the raw-φ log was built on.
Observed, not imagined: one null in one φ vector silently replaced a
forty-patch, gen-39 session with an empty one.
It is deliberately not quiet about the cost — Self::load and the
session layer both re-serialize what they read, so a skipped row is
gone from disk on the next save. That is the right trade only because
a row that cannot be parsed cannot be interpreted either; there is
nothing in it to keep.
Implementations§
Source§impl ObservationLog
impl ObservationLog
Sourcepub fn push(&mut self, obs: Observation)
pub fn push(&mut self, obs: Observation)
Append an observation.
Sourcepub fn n_sessions(&self) -> usize
pub fn n_sessions(&self) -> usize
Number of distinct sessions referenced (max session index + 1).
Sourcepub fn n_with(&self, provenance: Provenance) -> usize
pub fn n_with(&self, provenance: Provenance) -> usize
How many observations were collected each way. A count, not a weight: nothing downstream of the likelihood reads it, and the panel shows it so “the model learned this from a heard comparison” and “…from a checkbox” are distinguishable claims on screen as well as in the log.
Trait Implementations§
Source§impl Clone for ObservationLog
impl Clone for ObservationLog
Source§fn clone(&self) -> ObservationLog
fn clone(&self) -> ObservationLog
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ObservationLog
impl Debug for ObservationLog
Source§impl Default for ObservationLog
impl Default for ObservationLog
Source§fn default() -> ObservationLog
fn default() -> ObservationLog
Source§impl<'de> Deserialize<'de> for ObservationLog
impl<'de> Deserialize<'de> for ObservationLog
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for ObservationLog
impl PartialEq for ObservationLog
Source§fn eq(&self, other: &ObservationLog) -> bool
fn eq(&self, other: &ObservationLog) -> bool
self and other values to be equal, and is used by ==.