Why a two-parameter model beat Random Forest

In our MATH4069 challenge, we tried Random Forests, per-type Random Forests, and feature-enriched ensembles. None of them worked as well as a simple linear regression with one predictor per impurity type.

The reason came down to structure. When you stratify by type, each channel–percentage relationship is near-perfectly linear. The within-type R² averaged 0.906 across all thirteen types. A Random Forest with 500 trees on five training points doesn’t stand a chance — it memorises, it doesn’t generalise.

The lesson: model selection must be guided by the structure of the data, not by the default flexibility of popular methods. A two-parameter linear model outperformed a Random Forest with thousands of implicit parameters — because the problem’s structure was linear.

We scored 98. The next best group scored 113. Sometimes the simplest answer is the right one, but only if you’ve done the EDA to prove it.

Deploying DeltaConvert: Docker, SSL, and the joy of Nginx

DeltaConvert started as a simple Flask app. Getting it live on a Hetzner CX43 with Docker Compose, Certbot SSL, and proper file validation turned out to be the real engineering challenge.

The ACCEPT_MAP system for file type validation, lazy-loading EasyOCR to prevent startup crashes, rewriting nginx.conf via Python scripts because bash special characters are evil — each problem taught me something that no tutorial covers.

The biggest lesson: production deployment is a completely different discipline from writing application code. The gap between “it works on my machine” and “it works on the internet” is where engineering lives.

Increment vs. absolute: reframing the prediction target

For the train delay challenge, we spent three weeks trying to predict the final Nottingham delay directly. The breakthrough came when we stopped doing that.

Instead, we modelled the Sheffield–Nottingham increment — the delay change after the last observed station. The distribution was tighter, the variance lower, and the XGBoost model could focus on what actually mattered: downstream delay evolution, not re-predicting what we already knew.

Sometimes the best modelling decision isn’t about the model. It’s about the question.

Our MSE dropped from 32,505 in Week 2 to 28,078 in Week 5. The model class change (Random Forest to XGBoost) helped, but the target reformulation was the real driver.

Training 29 LSTM models inside Docker

Stochastix forecasts 30-day exchange rates for 29 currency pairs. Each pair gets its own LSTM model trained on ECB historical data.

Training all 29 models locally inside Docker was an exercise in patience and memory management. The trick was sequential training with explicit garbage collection between models — loading one dataset, training, saving weights, clearing memory, then moving to the next pair.

A daily cron job now auto-resolves prediction audits against live ECB rates. The system scores itself every morning before I wake up.

The bias-variance tradeoff is not just theory

In Week 3 of our chemicals challenge, we trained per-type Random Forests. Each type had 5 to 10 observations. The score went from 147 to 161. Worse.

The problem was textbook: with n=5 training points, each bootstrap sample contains roughly 3.2 distinct observations. The OOB set has 1.8 points. The variance term in the bias-variance decomposition completely dominated.

R even warned us: “The response has five or fewer unique values. Are you sure you want to do regression?”

We should have listened. The fix was embarrassingly simple — replace the forest with a two-parameter linear model. Bias went up slightly. Variance collapsed. Net result: a 63-point improvement.

The bias-variance tradeoff is real. It’s not just a diagram in a textbook. It’s the difference between first place and last.

From Delhi to Nottingham

Moving from a pure mathematics degree to an MSc in Data Science felt like switching from theory to practice overnight. The mathematical foundations are the same — probability, linear algebra, optimisation — but the emphasis shifts entirely.

In Delhi, we proved theorems. In Nottingham, we build things that work. Both matter. The best data scientists I’ve met do both.

The South Asia Postgraduate Excellence Award helped make the move possible. The INSPIRE Scholarship before that kept me going through three years of mathematics in India. I don’t take either for granted.