{
  "id": 21892262,
  "title": "Feature Engineering for Sensor Telemetry: Windowing, Rolling Stats, and the Leaks That Fool You",
  "url": "https://urgent.news/2026/11/26/feature-engineering-for-sensor-telemetry-windowing-rolling-stats-and",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-11-26T00:40:40.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/mp3sss31/feature-engineering-for-sensor-telemetry-windowing-rolling-stats-and-the-leaks-that-fool-you-10ma"
  },
  "original_language": "en",
  "account": "Many IoT models perform well offline but fail in real-world production due to feature computation discrepancies. This article discusses windowing, rolling statistics, gap handling, and leakage patterns that inflate offline metrics. The code presented is in plain Python with NumPy, ensuring readability for those porting the features to C. Telemetry is not a simple table; it has properties that break traditional table assumptions. Irregular arrival, gaps, non-monotonic time, and multiple rates are common issues that can corrupt rolling window calculations if performed on row indices rather than time.\n\nTo address these issues, the article introduces window types and their appropriate use cases. Tumbling windows provide fixed-duration non-overlapping intervals, while sliding windows offer overlapping intervals with lower detection latency. For alerting, a sliding window with a hop of 10-25% of the window length is recommended. The article also explains time-based resampling onto a fixed grid, keeping last values in duplicated buckets and handling missing buckets as explicit NaNs. This approach ensures accurate downstream rolling calculations.\n\nThe author provides a simple implementation of rolling statistics (mean and standard deviation) using a time-ordered stream, which can be implemented with O(1) per sample complexity. This is crucial for devices with limited computational resources. Additionally, the article emphasizes the need for robust features in industrial signals, recommending the use of median and interquartile range instead of mean and standard deviation, as the latter are sensitive to outliers.",
  "summary": "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…",
  "key_points": [
    "Discusses windowing, rolling statistics, gap handling, and leakage patterns in IoT telemetry",
    "Recommends sliding windows with 10-25% hop for alerting and time-based resampling"
  ],
  "editors_take": "Prioritizing time-based windowing over row indices prevents data leakage and ensures that IoT models maintain their predictive accuracy when transitioning from offline training to real-world production environments.",
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}