how-to-feature-to-modellisted
Install: claude install-skill phoebefu6/phoebe-data-skills
# how-to-feature-to-model
Data-Science-layer skill (layer 3 of the phoebe-data-skills 4-layer roadmap).
The model is twenty lines. Everything that decides whether it is worth anything
happens before and after it: whether each feature could have been known at the
moment of the decision, whether the label had time to arrive, whether the score
you are celebrating is reachable at all, and whether acting on it pays.
Showcase walkthrough (Everrest retail case, real executed charts):
`docs/how-to-feature-to-model/` in https://github.com/phoebefu6/phoebe-data-skills
## Where this sits in the lineage
`raw dump -> lake -> warehouse -> marts` **-> modelling table -> scored decision**.
Reads the clean marts. Clean does not mean modellable: the marts carry duplicate
order ids, a status column that is only known after the fact, and an outcome that
arrives up to 20 days late. None of that is a data-quality failure. All of it will
wreck a model.
## The five rules
1. **Every fact has its own availability lag.** That an order happened is known
instantly. Whether it came back is known weeks later. One as-of cutoff for both
silently trains on labels that had not been observed. Use `lag_days=0` for
activity, a measured maturity window for outcomes.
2. **`groupby(key).label.transform("mean")` is not a feature.** It reads the
future and it includes the row's own label. On sparse entities that is most of
the signal. Use `asof.add_history`.
3. **Cut the label where the clock ha