Sitemap
TDS Archive

An archive of data science, data analytics, data engineering, machine learning, and artificial intelligence writing from the former Towards Data Science Medium publication.

Member-only story

Porting Twitter’s Anomaly Detection Algorithm To Swift

12 min readNov 29, 2024

--

Zoomed in image of my ADS App.

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…

--

--

TDS Archive
TDS Archive

Published in TDS Archive

An archive of data science, data analytics, data engineering, machine learning, and artificial intelligence writing from the former Towards Data Science Medium publication.