# name
Comparative Study of Clustering Techniques for Hypnogram Analysis and User-Level Insights

# metadata.dc.description[].value
Treballs finals del Màster de Fonaments de Ciència de Dades, Facultat de matemàtiques, Universitat de Barcelona. Any: 2026. Tutor: Santi Seguí Mesquida i María Brull Martínez

# metadata.dc.description.abstract[].value
This thesis aims to develop an unsupervised clustering framework to identify patterns in sleep data recorded by wearable devices. The work compares different algorithms, focusing on distance metrics and feature representations tailored to categorical time series. Firstly, it presents a comparative review of the literature on sleep pattern clustering from polysomnography and wearable data. It summarizes common approaches, feature engineering and validation strategies, and analyses how these methods influence the choices made in this work. Secondly, six clustering algorithms are applied to the sleep data and evaluated using standard clustering scores and the evolution of inertia as the number of clusters increases, in order to assess both stability and interpretability. In particular, the k-modes baseline produces clusters that fail to capture clear differences in sleep patterns, while agglomerative clustering with Hamming distance applied to a distance matrix generates very distinctive but unbalanced groups. To obtain more stable and interpretable groups, K-means clustering is explored using both Dynamic Time Warping (although the algorithm is not designed for categorical data) on the full sequences and a compact feature-based representation including sleep efficiency, REM and deep sleep percentages, and the number of awakenings lasting longer than 5 minutes. Finally, feature-envelope approaches that summarize the temporal evolution of these features across the night are implemented, obtaining a higher quality clustering results and a better characterization of sleep patterns. The conclusions focus primarily on lower values of k, where clustering metrics indicate better performance, suggesting that the underlying structure of the data is more continuous than discrete.

# metadata.dc.rights[].value
memòria: cc-by-nc-nd (c) Carmen Casas Herce, 2026

# metadata.dc.source[].value
Màster Oficial - Fonaments de la Ciència de Dades

# metadata.dc.title[].value
Comparative Study of Clustering Techniques for Hypnogram Analysis and User-Level Insights