<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>DTW on Stuart Lacy</title><link>/tags/dtw/</link><description>Recent content in DTW on Stuart Lacy</description><generator>Hugo -- gohugo.io</generator><language>en-uk</language><copyright>&amp;copy; 2023 Stuart Lacy</copyright><lastBuildDate>Tue, 21 Apr 2026 00:00:00 +0000</lastBuildDate><atom:link href="/tags/dtw/index.xml" rel="self" type="application/rss+xml"/><item><title>Clustering running data using Dynamic Time Warping</title><link>/2026/04/21/clustering-running-data-using-dynamic-time-warping/</link><pubDate>Tue, 21 Apr 2026 00:00:00 +0000</pubDate><guid>/2026/04/21/clustering-running-data-using-dynamic-time-warping/</guid><description>Motivation I recently needed to implement some time-series clustering at work on a high-dimensional dataset. Having not tackled this specific problem before, I wanted to practice on a smaller, univariate dataset where I already had a strong intuition about the underlying structure.
I turned to my exported Strava running data as a testbed to get familiar with clustering using Dynamic Time Warping (DTW).
Heartrate data Show the code library(tidyverse) library(duckdb) library(plotly) library(dtw) library(parallel) library(tidytext) library(ggwordcloud) library(patchwork) library(dendextend) library(ggridges) library(broom) library(cluster) I started by pulling data from my existing database, restricting the scope to runs that contain both heart rate and GPS location data.</description></item></channel></rss>