Cluster Error Logs with Sentence-Transformers and HDBSCAN
Advanced · 45 minutes · 100 points
In this advanced AI lab, you will generate a realistic dataset of thousands of error log lines, embed them using sentence-transformers, reduce dimensionality with UMAP, cluster the embeddings with HDBSCAN, and print each cluster's size along with a representative message. This pipeline mirrors real-world observability workflows for automatically discovering new or recurring error types in production systems.
What you’ll learn
- Generate a synthetic but realistic dataset of 3000+ error log lines across multiple error categories
- Embed all log lines into dense vector representations using sentence-transformers (all-MiniLM-L6-v2)
- Reduce embedding dimensionality with UMAP and cluster with HDBSCAN to surface distinct error groups
- Interpret clustering results by printing each cluster's size and one representative message
How this lab works
- Start the lab: One click starts a container on your computer with a real terminal: nothing to install by hand, nothing to clean up.
- Work through 4 tasks: Each task says what to build or fix. You do it yourself, in a real terminal, with hints when you get stuck.
- Check your work: Check my work runs each task’s checks in your container and says what passed and what to fix.
- Finish and keep going: 100 points, your progress saved, and the next lab to try.
What it runs on
- Runs: A container on your computer, with a real terminal
- Image: python:3.12-slim
What you need
- A free LearnXops account
- The LearnXops desktop app for macOS, Windows or Linux
- Docker Desktop installed and running
- At least 4GB RAM available for Docker
- Internet access to pull the container image and download the model
Topics: sentence-transformers, hdbscan, umap, nlp, embeddings, clustering, log-analysis, observability, python, machine-learning
Create a free account to start this lab.