Menu

Feature Engineering for Sensor Telemetry: Windowing, Rolling Stats, and the Leaks That Fool You
πŸ“°

Feature Engineering for Sensor Telemetry: Windowing, Rolling Stats, and the Leaks That Fool You

DEV Community: pythonΒ·mp3sssΒ·10 days ago
#UE0LN4QR
#devtopython#devto#dev#self#device
Long article (2094 words) β€” no AI summary yet.
Reading 0:00
15s threshold

The most common reason an IoT model looks great offline and useless in production is not the model. It is the features β€” specifically, the difference between how features were computed in the notebook and how they are computed on the gateway.

This post covers windowing, rolling statistics, gap handling, and the leakage patterns that quietly inflate offline metrics. All the code is plain Python plus NumPy, because feature code should be readable by the person who has to port it to C.

Telemetry is not a table

A training set built from a CSV of sensor rows teaches the wrong mental model. Real telemetry has properties that break table-shaped assumptions:

Irregular arrival. A 100 Hz sensor does not deliver exactly 100 rows per second. Buffering, retries, and clock drift produce jitter.

Gaps. Devices reboot, gateways lose uplink, messages are dropped. Gaps are normal, not exceptional.

Monotonic-ish time with resets. Device clocks jump backwards after NTP sync or battery replacement.

Multiple rates.…

Continue reading β€” create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.