Member-only story
Porting Twitter’s Anomaly Detection Algorithm To Swift
From Twitter to Swift: Building Anomaly Detection.
Twitter (now X), back in 2015 made an Anomaly Detection Algorithm for use in tracking trends among their millions of users.
This package, made entirely in R, is still very usable. It was designed to be able to detect global and local anomalies, and it is able to successfully detect a wide variety of anomalies. For a complete list of what it can and can’t detect please check out Anomaly.io’s test of the original algorithm, as it is very comprehensive.
Why Port it to Swift?
Why not 🤷♂️? I was bored.
Understanding Twitter’s Anomaly Detection Algorithm
Twitter’s Anomaly Detection Algorithm is a statistical framework designed for detecting anomalies, or outliers, in a time-series dataset.
There are two main core components to the algorithm.
- Seasonal Decomposition: The algorithm…