TFiltersPy: Kalman and particle filters for Python
You should not have to become a specialist to get a clean signal
Real sensors lie, and the mathematics that corrects them is well established but different for every method. TFiltersPy puts five Bayesian filters behind one familiar fit, predict and score interface, so choosing a method becomes a decision about the problem rather than a rewrite of everything around it.
- What it is
- Open source software
- Role
- Author and maintainer
- Organisation
- Ubunye AI Ecosystems
- Period
- 2025 to present (repository created March 2025; version 1.0.6)
- Status
- Maintained
- Licence
- MIT
- Package authors
- Thabang L. Mashinini-Sekgoto, Lebogang L. Sekgoto, Palesa L. Sekgoto
- Built with
- Python
- NumPy
- Dask
- Topics
- Bayesian filtering
- Kalman filtering
- Particle filtering
- Ensemble Kalman filter
- State estimation
- Time series
- Open source software
- Telematics

The problem
Real sensors lie. GPS drifts, radar is noisy, vehicle trackers and IoT devices produce readings you cannot use directly, and you need an honest estimate of the state underneath the noise.
Why it mattered
Bayesian filtering solves this and the mathematics is well established, but re-deriving Kalman, Particle or Ensemble filters from papers on each new project is slow and error prone. The bigger problem was that existing implementations tended to assume a state-estimation background, so a practitioner who simply needed a clean signal had to become a specialist first, or find one.
The context
The recurring context was telemetry: the same class of noisy time-series problem appearing across telecommunications and banking, in telematics and IoT. The methods themselves are not specific to vehicles, which shaped the scope. The same five filters serve radar tracking, robot localisation, high-dimensional weather and ocean models, EEG, image denoising, and even smoothing signals in text.
What I did
I built TFiltersPy as an open-source Python library. The design decision that mattered was familiarity: every filter follows the scikit-learn convention, so fit, predict, score, get_params and set_params behave the way a practitioner already expects, and switching methods does not mean rewriting the code around them. It follows that convention rather than depending on scikit-learn, so the package installs with numpy, scipy and dask and nothing else. I also wrote the part people actually get stuck on, a decision guide for choosing among the five: a Kalman filter for linear systems, an Extended Kalman filter where you can supply Jacobians, an Unscented Kalman filter where you cannot, an Ensemble Kalman filter for very high-dimensional states, and a Particle filter for non-Gaussian or multimodal problems. It is built to scale beyond one machine: there are Dask-parallel variants of the Kalman and particle filters, and the ensemble filter propagates its members through Dask by default.
What changed
Filtering stopped being a re-derivation exercise and became fitting a familiar estimator. Beyond the forward pass, every filter has a filter_step call for online use against a live stream, the linear and extended filters add RTS smoothing, and the linear one forecasts a number of steps ahead. Particle degeneracy is visible rather than silent, recorded per step as an effective sample size, and the Kalman filter can drop its stored covariances for very long series, which trades the ability to smooth for the memory to keep going.
Who benefited
Engineers and scientists working with noisy time series who are not filtering specialists, starting with the telemetry problems across telecommunications and banking that it was built from.
What remained
A published, documented library on PyPI: five filters behind one API, worked examples for GPS vehicle tracking, radar tracking as a direct EKF against UKF comparison, and robot localisation, notebooks covering EEG, image denoising and benchmarks across all five, a decision guide for choosing between them, and a test suite of forty one tests run on Python 3.9 through 3.12.
Technical context
Python, NumPy, SciPy and Dask, an estimator API following the scikit-learn convention rather than depending on it, Dask-parallel Kalman and particle variants, a parameter estimator with four noise-estimation strategies, 41 tests on a Python 3.9 to 3.12 matrix, PyPI.
Lineage
- Came before
- kalmanfilter-. Kalman and particle filter implementations from first principles (2023). Its own description says the ideas became TFiltersPy.
Related research
Related work
- Shares telematics, pythonData science platform at a bank: telematics and MLOpsAt Absa Group: architected the data engineering capability data science runs on, with Ubunye Engine at 100M+ events a day for 10+ products.
- Shares open source software, pythonUbunye Engine: portable Spark pipelines for data and MLUbunye Engine is an open source Python framework for config driven Spark pipelines. The same task folder runs on a laptop, Docker, Kubernetes or Databricks.
- Shares open source softwareAgent Roadmap Kit: learn AI agents by building one, freeA free, open source companion to the six part agents series: six stops that build one working assistant, runnable at no cost.
- Shares pythonClimate forecasting and geospatial ML at IBM ResearchApplied ML research at IBM Research: climate forecasting models deployed into IBM PAIRS Geoscope, published work, and a provincial COVID-19 risk dashboard.