# Data Science Portfolio

Welcome! I'm **Alun**, a Statistical Methodologist at the UK Office for National Statistics with a PhD in Computational Physics. This portfolio showcases projects spanning machine learning, computer vision, time series analysis, NLP, small-area estimation, and applied statistics.

## Featured Projects

<div style="display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 2em; margin: 2em 0;">

<div style="background: linear-gradient(135deg, #0d3b4c 0%, #c45c26 100%); color: white; padding: 2em; border-radius: 10px; box-shadow: 0 4px 6px rgba(0,0,0,0.1); transition: transform 0.3s;">
  <div style="font-size: 3em; margin-bottom: 0.5em;">📻</div>
  <h3 style="color: white; margin-top: 0;"><a href="projects/spotify-power-laws/index.html" style="color: white; text-decoration: none;">Power Laws and Popularity</a></h3>
  <p style="margin-bottom: 1em; opacity: 0.95;">What 50,000 synthetic Spotify tracks can and cannot tell you: leakage, grouped validation, and a model ladder that stops when capacity stops paying.</p>
  <div style="display: flex; gap: 0.5em; flex-wrap: wrap;">
    <span style="background: rgba(255,255,255,0.2); padding: 0.3em 0.8em; border-radius: 15px; font-size: 0.85em;">Estimands</span>
    <span style="background: rgba(255,255,255,0.2); padding: 0.3em 0.8em; border-radius: 15px; font-size: 0.85em;">Validation</span>
    <span style="background: rgba(255,255,255,0.2); padding: 0.3em 0.8em; border-radius: 15px; font-size: 0.85em;">Forensics</span>
    <span style="background: rgba(255,255,255,0.2); padding: 0.3em 0.8em; border-radius: 15px; font-size: 0.85em;">Uncertainty</span>
  </div>
</div>

<div style="background: linear-gradient(135deg, #0b3d4a 0%, #c0392b 100%); color: white; padding: 2em; border-radius: 10px; box-shadow: 0 4px 6px rgba(0,0,0,0.1); transition: transform 0.3s;">
  <div style="font-size: 3em; margin-bottom: 0.5em;">🩺</div>
  <h3 style="color: white; margin-top: 0;"><a href="projects/cancer-imaging/index.html" style="color: white; text-decoration: none;">Finding Cancer in Ultrasound Images</a></h3>
  <p style="margin-bottom: 1em; opacity: 0.95;">A model ladder on public BreastMNIST ultrasound — from PCA-logistic and HOG forests to a small CNN and ResNet-18 transfer, with Grad-CAM explanations and a full metric dashboard.</p>
  <div style="display: flex; gap: 0.5em; flex-wrap: wrap;">
    <span style="background: rgba(255,255,255,0.2); padding: 0.3em 0.8em; border-radius: 15px; font-size: 0.85em;">Computer Vision</span>
    <span style="background: rgba(255,255,255,0.2); padding: 0.3em 0.8em; border-radius: 15px; font-size: 0.85em;">Medical Imaging</span>
    <span style="background: rgba(255,255,255,0.2); padding: 0.3em 0.8em; border-radius: 15px; font-size: 0.85em;">Grad-CAM</span>
    <span style="background: rgba(255,255,255,0.2); padding: 0.3em 0.8em; border-radius: 15px; font-size: 0.85em;">PyTorch</span>
  </div>
</div>

<div style="background: linear-gradient(135deg, #0d3b4c 0%, #2a9d8f 100%); color: white; padding: 2em; border-radius: 10px; box-shadow: 0 4px 6px rgba(0,0,0,0.1); transition: transform 0.3s;">
  <div style="font-size: 3em; margin-bottom: 0.5em;">📐</div>
  <h3 style="color: white; margin-top: 0;"><a href="projects/small-area-estimation/index.html" style="color: white; text-decoration: none;">Small Area Estimation for UK Local Authorities</a></h3>
  <p style="margin-bottom: 1em; opacity: 0.95;">Fay–Herriot EBLUP and a Bayesian hierarchical model for APS unemployment rates, validated against ONS published model-based estimates.</p>
  <div style="display: flex; gap: 0.5em; flex-wrap: wrap;">
    <span style="background: rgba(255,255,255,0.2); padding: 0.3em 0.8em; border-radius: 15px; font-size: 0.85em;">Official Statistics</span>
    <span style="background: rgba(255,255,255,0.2); padding: 0.3em 0.8em; border-radius: 15px; font-size: 0.85em;">Fay–Herriot</span>
    <span style="background: rgba(255,255,255,0.2); padding: 0.3em 0.8em; border-radius: 15px; font-size: 0.85em;">PyMC</span>
    <span style="background: rgba(255,255,255,0.2); padding: 0.3em 0.8em; border-radius: 15px; font-size: 0.85em;">Nomis</span>
  </div>
</div>

<div style="background: linear-gradient(135deg, #4a0e0e 0%, #c9a227 100%); color: white; padding: 2em; border-radius: 10px; box-shadow: 0 4px 6px rgba(0,0,0,0.1); transition: transform 0.3s;">
  <div style="font-size: 3em; margin-bottom: 0.5em;">📚</div>
  <h3 style="color: white; margin-top: 0;"><a href="projects/literary-nlp/index.html" style="color: white; text-decoration: none;">Literary NLP: Sentiment Across Classic Novels</a></h3>
  <p style="margin-bottom: 1em; opacity: 0.95;">Sentiment, emotion, term frequency, word clouds, and character presence mapped through eight public-domain novels — from <em>Dracula</em> to <em>A Christmas Carol</em>.</p>
  <div style="display: flex; gap: 0.5em; flex-wrap: wrap;">
    <span style="background: rgba(255,255,255,0.2); padding: 0.3em 0.8em; border-radius: 15px; font-size: 0.85em;">NLP</span>
    <span style="background: rgba(255,255,255,0.2); padding: 0.3em 0.8em; border-radius: 15px; font-size: 0.85em;">Sentiment</span>
    <span style="background: rgba(255,255,255,0.2); padding: 0.3em 0.8em; border-radius: 15px; font-size: 0.85em;">VADER</span>
    <span style="background: rgba(255,255,255,0.2); padding: 0.3em 0.8em; border-radius: 15px; font-size: 0.85em;">Plotly</span>
  </div>
</div>

<div style="background: linear-gradient(135deg, #1b5e20 0%, #f9a825 100%); color: white; padding: 2em; border-radius: 10px; box-shadow: 0 4px 6px rgba(0,0,0,0.1); transition: transform 0.3s;">
  <div style="font-size: 3em; margin-bottom: 0.5em;">🏏</div>
  <h3 style="color: white; margin-top: 0;"><a href="projects/cricket-win-probability/index.html" style="color: white; text-decoration: none;">ODI Win Probability: From DLS to Data</a></h3>
  <p style="margin-bottom: 1em; opacity: 0.95;">Ball-by-ball win probability for one-day cricket — simplified DLS resource baselines, logistic regression and LightGBM models, and interactive chase charts.</p>
  <div style="display: flex; gap: 0.5em; flex-wrap: wrap;">
    <span style="background: rgba(255,255,255,0.2); padding: 0.3em 0.8em; border-radius: 15px; font-size: 0.85em;">Sports Analytics</span>
    <span style="background: rgba(255,255,255,0.2); padding: 0.3em 0.8em; border-radius: 15px; font-size: 0.85em;">Calibration</span>
    <span style="background: rgba(255,255,255,0.2); padding: 0.3em 0.8em; border-radius: 15px; font-size: 0.85em;">Cricsheet</span>
    <span style="background: rgba(255,255,255,0.2); padding: 0.3em 0.8em; border-radius: 15px; font-size: 0.85em;">Plotly</span>
  </div>
</div>

<div style="background: linear-gradient(135deg, #1565c0 0%, #00838f 100%); color: white; padding: 2em; border-radius: 10px; box-shadow: 0 4px 6px rgba(0,0,0,0.1); transition: transform 0.3s;">
  <div style="font-size: 3em; margin-bottom: 0.5em;">📈</div>
  <h3 style="color: white; margin-top: 0;"><a href="projects/time-series-analysis/index.html" style="color: white; text-decoration: none;">Time Series Analysis: Classical Methods</a></h3>
  <p style="margin-bottom: 1em; opacity: 0.95;">A rigorous tour of classical forecasting — exponential smoothing, Fourier methods, ARIMA/SARIMA, and state-space models — applied to benchmark datasets from Air Passengers to Mauna Loa CO₂.</p>
  <div style="display: flex; gap: 0.5em; flex-wrap: wrap;">
    <span style="background: rgba(255,255,255,0.2); padding: 0.3em 0.8em; border-radius: 15px; font-size: 0.85em;">Time Series</span>
    <span style="background: rgba(255,255,255,0.2); padding: 0.3em 0.8em; border-radius: 15px; font-size: 0.85em;">Forecasting</span>
    <span style="background: rgba(255,255,255,0.2); padding: 0.3em 0.8em; border-radius: 15px; font-size: 0.85em;">statsmodels</span>
    <span style="background: rgba(255,255,255,0.2); padding: 0.3em 0.8em; border-radius: 15px; font-size: 0.85em;">Seasonal Adjustment</span>
  </div>
</div>

<div style="background: linear-gradient(135deg, #2c3e50 0%, #4a6741 100%); color: white; padding: 2em; border-radius: 10px; box-shadow: 0 4px 6px rgba(0,0,0,0.1); transition: transform 0.3s;">
  <div style="font-size: 3em; margin-bottom: 0.5em;">🕸️</div>
  <h3 style="color: white; margin-top: 0;"><a href="projects/uk-urban-systems-network/index.html" style="color: white; text-decoration: none;">UK Urban Systems Network</a></h3>
  <p style="margin-bottom: 1em; opacity: 0.95;">A UK replication of the French <em>systèmes urbains régionaux</em> cartogram: TTWA nodes, census commuting flows, and Nystuen–Dacey dominant-flow partitions built in R.</p>
  <div style="display: flex; gap: 0.5em; flex-wrap: wrap;">
    <span style="background: rgba(255,255,255,0.2); padding: 0.3em 0.8em; border-radius: 15px; font-size: 0.85em;">Geospatial Analysis</span>
    <span style="background: rgba(255,255,255,0.2); padding: 0.3em 0.8em; border-radius: 15px; font-size: 0.85em;">Network Analysis</span>
    <span style="background: rgba(255,255,255,0.2); padding: 0.3em 0.8em; border-radius: 15px; font-size: 0.85em;">Census</span>
    <span style="background: rgba(255,255,255,0.2); padding: 0.3em 0.8em; border-radius: 15px; font-size: 0.85em;">R</span>
  </div>
</div>

<div style="background: linear-gradient(135deg, #1f4e79 0%, #2d6a4f 100%); color: white; padding: 2em; border-radius: 10px; box-shadow: 0 4px 6px rgba(0,0,0,0.1); transition: transform 0.3s;">
  <div style="font-size: 3em; margin-bottom: 0.5em;">🗺️</div>
  <h3 style="color: white; margin-top: 0;"><a href="projects/uk-terrain-rugby/index.html" style="color: white; text-decoration: none;">UK Terrain &amp; Rugby Geography</a></h3>
  <p style="margin-bottom: 1em; opacity: 0.95;">Raster and vector spatial analysis using the <code style="background: rgba(255,255,255,0.2); color: white; padding: 0.1em 0.35em; border-radius: 4px;">tidyterra</code> R package. Combines UK elevation data with English Premiership rugby club locations to explore the geography of the game.</p>
  <div style="display: flex; gap: 0.5em; flex-wrap: wrap;">
    <span style="background: rgba(255,255,255,0.2); padding: 0.3em 0.8em; border-radius: 15px; font-size: 0.85em;">Geospatial Analysis</span>
    <span style="background: rgba(255,255,255,0.2); padding: 0.3em 0.8em; border-radius: 15px; font-size: 0.85em;">tidyterra</span>
    <span style="background: rgba(255,255,255,0.2); padding: 0.3em 0.8em; border-radius: 15px; font-size: 0.85em;">terra</span>
    <span style="background: rgba(255,255,255,0.2); padding: 0.3em 0.8em; border-radius: 15px; font-size: 0.85em;">R</span>
    <span style="background: rgba(255,255,255,0.2); padding: 0.3em 0.8em; border-radius: 15px; font-size: 0.85em;">Sports Analytics</span>
  </div>
</div>

<div style="background: linear-gradient(135deg, #1f77b4 0%, #2ca02c 100%); color: white; padding: 2em; border-radius: 10px; box-shadow: 0 4px 6px rgba(0,0,0,0.1); transition: transform 0.3s;">
  <div style="font-size: 3em; margin-bottom: 0.5em;">🚢</div>
  <h3 style="color: white; margin-top: 0;"><a href="projects/titanic/index.html" style="color: white; text-decoration: none;">Titanic Survival Analysis</a></h3>
  <p style="margin-bottom: 1em; opacity: 0.95;">A comprehensive walkthrough of classification modeling—from messy data to deployed predictions.</p>
  <div style="display: flex; gap: 0.5em; flex-wrap: wrap;">
    <span style="background: rgba(255,255,255,0.2); padding: 0.3em 0.8em; border-radius: 15px; font-size: 0.85em;">Machine Learning</span>
    <span style="background: rgba(255,255,255,0.2); padding: 0.3em 0.8em; border-radius: 15px; font-size: 0.85em;">Classification</span>
    <span style="background: rgba(255,255,255,0.2); padding: 0.3em 0.8em; border-radius: 15px; font-size: 0.85em;">EDA</span>
  </div>
</div>

<div style="background: linear-gradient(135deg, #ff7f0e 0%, #d62728 100%); color: white; padding: 2em; border-radius: 10px; box-shadow: 0 4px 6px rgba(0,0,0,0.1); transition: transform 0.3s;">
  <div style="font-size: 3em; margin-bottom: 0.5em;">🏉</div>
  <h3 style="color: white; margin-top: 0;"><a href="projects/french-rugby-voronoi/index.html" style="color: white; text-decoration: none;">French Rugby Voronoi Analysis</a></h3>
  <p style="margin-bottom: 1em; opacity: 0.95;">Geospatial analysis of French professional rugby teams using Voronoi diagrams. Showcases computational geometry, interactive mapping, and sports analytics.</p>
  <div style="display: flex; gap: 0.5em; flex-wrap: wrap;">
    <span style="background: rgba(255,255,255,0.2); padding: 0.3em 0.8em; border-radius: 15px; font-size: 0.85em;">Geospatial Analysis</span>
    <span style="background: rgba(255,255,255,0.2); padding: 0.3em 0.8em; border-radius: 15px; font-size: 0.85em;">Voronoi Diagrams</span>
    <span style="background: rgba(255,255,255,0.2); padding: 0.3em 0.8em; border-radius: 15px; font-size: 0.85em;">Sports Analytics</span>
  </div>
</div>

<div style="background: linear-gradient(135deg, #4b2e83 0%, #1f4e79 100%); color: white; padding: 2em; border-radius: 10px; box-shadow: 0 4px 6px rgba(0,0,0,0.1); transition: transform 0.3s;">
  <div style="font-size: 3em; margin-bottom: 0.5em;">🎸</div>
  <h3 style="color: white; margin-top: 0;"><a href="projects/beatles-discography/index.html" style="color: white; text-decoration: none;">Beatles Discography Visual Story</a></h3>
  <p style="margin-bottom: 1em; opacity: 0.95;">Interactive music analytics using The Beatles Spotify dataset, including writer-level popularity and sunburst views of the full discography.</p>
  <div style="display: flex; gap: 0.5em; flex-wrap: wrap;">
    <span style="background: rgba(255,255,255,0.2); padding: 0.3em 0.8em; border-radius: 15px; font-size: 0.85em;">Data Visualization</span>
    <span style="background: rgba(255,255,255,0.2); padding: 0.3em 0.8em; border-radius: 15px; font-size: 0.85em;">Music Analytics</span>
    <span style="background: rgba(255,255,255,0.2); padding: 0.3em 0.8em; border-radius: 15px; font-size: 0.85em;">Plotly</span>
  </div>
</div>

</div>

## Technical Stack

**Languages & Tools:** Python • R • SQL • Statistical Modelling • Machine Learning • Computer Vision • NLP • Geospatial Analysis • Time Series • Seasonal Adjustment • Reproducible Analytical Pipelines

**Key Libraries (Python):** scikit-learn • PyTorch • pandas • numpy • matplotlib • plotly • nltk • geopandas • shapely • folium • pymc  
**Key Libraries (R):** rjd3/JDemetra+ • KFAS • xts • tidyverse • Shiny • Quarto

## About This Portfolio

This site is built with [Jupyter Book](https://jupyterbook.org/), which allows me to combine narrative explanations with executable code. Each project tells a complete story—from initial data exploration through modeling to final conclusions—while maintaining reproducibility and technical rigor.

All code is open-source and available on [GitHub](https://github.com/areeslindley/projects-website). Feel free to explore, learn, and adapt the analyses for your own work.

---

*Last updated: 2026*
