Asked about Data where order carries meaning

How do you build a rolling average feature safely?

An answer that works

Shift before rolling, so the window covers only past values. A rolling mean that includes the current row leaks the target and produces a model that cannot work in production.

Reading an answer is not being able to give one. The section that teaches this is Data where order carries meaning, 5 hours of Time series.

Learn this properly