Data and modeling

Machine learning for time series data

Machine learning on time series covers forecasting future values, classifying windows of a signal and detecting unusual periods. Typical uses are energy-demand forecasting, recognising activities from wearable sensors and monitoring equipment.

How machine learning is used on time series data

Forecasting energy generation and demand

Grid operators need forecasts of solar output and electricity demand minutes to days ahead to balance the system. Models combine recent readings with weather forecasts and satellite imagery.

Real exampleOpen Climate Fix solar forecasting for NESOOpen Climate Fix built an AI solar forecast with the UK's National Energy System Operator, which it says is now used daily in NESO's control room.

Recognising activities from wearable sensors

Windows of accelerometer and gyroscope readings are classified into activities such as walking, running or climbing stairs. Convolutional and recurrent networks learn features directly from the raw signal.

Real exampleDeep, Convolutional, and Recurrent Models for Human Activity Recognition (Hammerla, Halloran and Ploetz, 2016)The paper compares deep, convolutional and recurrent approaches on three datasets of movement data captured with wearable sensors.

Detecting unusual periods in telemetry

A model forecasts each channel a few steps ahead, and large, persistent errors are flagged as anomalies. This scales to thousands of signals that no one could watch by hand.

Real exampleDetecting Spacecraft Anomalies Using LSTMs (NASA JPL, KDD 2018)The authors use LSTM networks with nonparametric dynamic thresholding on expert-labelled telemetry anomaly data from the SMAP satellite and the Curiosity rover.

Classifying physiological signals

Electrocardiograms and other biosignals are classified segment by segment into rhythm or event types. In research settings, deep networks trained on large labelled collections are compared with expert readers.

Real exampleArrhythmia detection in ambulatory ECGs (Hannun et al., Nature Medicine 2019)The research team trained a deep neural network on 91,232 single-lead ECGs from 53,549 patients to classify 12 rhythm classes and evaluated it against cardiologist-annotated test data.

Can you learn machine learning for time series?

Yes. Time series work uses the same Python stack as other machine learning, plus a few ideas specific to ordered data: lags, seasonality, and validation that never trains on the future. Learn pandas date handling and classical baselines before deep models.

  1. pandas for dates and resamplingParse timestamps, resample to regular intervals, fill gaps and build lag and rolling features.Learn it in Data Tools
  2. Statistics of dependent dataLearn autocorrelation and why ordinary independence assumptions fail for time series.Learn it in Statistics
  3. Forecasting and time-aware validationCompare seasonal naive, exponential smoothing and gradient boosting forecasts with rolling-origin evaluation.Learn it in Machine Learning
  4. Sequence modelsTrain convolutional, recurrent and transformer models on windows of signal for classification and forecasting.Learn it in Deep Learning

Moving into time series machine learning

If you already work in the field

Engineers, energy analysts and scientists who already work with sensor or demand data know its quirks: gaps, resets and seasonal patterns. Add Python and a time-aware validation habit, then beat a same-time-last-week baseline on your own data.

If you come from data science or ML

If you come from tabular ML, learn the leakage traps unique to time: random splits, features computed with future data and targets that overlap in time. Practise with rolling-origin evaluation and talk to the people who use the forecast about the horizon they need.

Roles that do this workForecasting data scientistEnergy data scientistSignal processing engineerMachine learning engineerDemand planner

Tools you will use

ToolWhat you use it for
pandasResample, lag and roll timestamped data into model-ready features.
statsmodelsDecompose series and fit ARIMA and exponential smoothing baselines.
sktimeForecast, classify and cross-validate time series with a scikit-learn-style interface.
tsfreshExtract many statistical features from signal windows for classification.

Public data to practise on

Your first project

Download the Individual Household Electric Power Consumption dataset, forecast next-day consumption with gradient boosting on lagged daily totals, and compare it with a same-day-last-week baseline using mean absolute error on the final months.

Common questions

Can I use random train and test splits on time series?

No. Random splits let the model learn from the future, which inflates scores. Train on earlier data and test on later data, ideally with several rolling cut-off points.

Is ARIMA machine learning?

ARIMA is a classical statistical model, but it is fitted to data and judged on forecasts like any ML model. It remains a strong baseline that more complex models should beat.

Which Python libraries are used for time series?

pandas for date handling, statsmodels and StatsForecast for classical models, sktime and Darts for unified interfaces, tsfresh for feature extraction, and PyTorch for deep sequence models.

Courses for these skills

New to programming or maths? Start with Python, or follow the machine learning path in order. Published lessons are free to read; compare Free and Pro.