Skip to main content

should_publish

Function should_publish 

Source
pub fn should_publish(
    mae_tree: f64,
    mae_ema: f64,
    corr: f64,
    published_corr: Option<f64>,
) -> bool
Expand description

The publish quality gate. The tree replaces the previous model only when its holdout MAE beats the exact per-sample EMA baseline on the same holdout slice and the Pearson correlation clears the quality floor and strictly improves on the currently committed model. The holdout MAE is weighted by the recency weights of the window, so recent samples dominate the gate. Correlation is monotonic: once a model at 0.30 is committed, a later fit at 0.30 or below is held out; 0.52 then 0.72 ratchet toward 1.0 on general workloads. A higher correlation must also beat the baseline, so a high but narrow fit on one game cannot regress the tail.

This is the daemon’s contract with the README’s claim that the tree is published when it beats the baseline: a regressed model is kept out and the previous model stays committed.