- CatBoost
- + LightGBM, k-fold CV
- macro-F1
- Threshold-tuned objective
- 5+
- Merged data sources
Tech stack
- Python
- pandas
- NumPy
- scikit-learn
- CatBoost
- LightGBM
- SHAP
Problem
Predict a user's gender from a set of heterogeneous behavioural signals — geography, referer vectors, and other tabular features — spread across several separate files that first have to be cleaned and joined into a single training set. The scoring metric is macro-F1, so the model has to perform well across classes, not just on the majority.
Approach
I built an end-to-end pipeline: ingest and clean the raw files, merge train / test / labels / geo / referer-vector sources on their keys, engineer features across the combined table, and train gradient-boosted models (CatBoost and LightGBM). Models were validated with k-fold cross-validation, and the decision threshold was tuned specifically to maximise macro-F1 rather than raw accuracy, with results benchmarked against simpler baselines.
Results
A reproducible pipeline that takes raw, multi-source data to a tuned, cross-validated classifier. Threshold tuning for macro-F1 measurably improved balanced performance over the default 0.5 cut-off, and SHAP / curve analysis made the model's behaviour interpretable.
Notable engineering
- End-to-end pipeline: data ingestion, cleaning, and merging of train / test / labels / geo / referer-vector sources.
- Feature engineering across heterogeneous inputs, then gradient-boosted models (CatBoost, LightGBM).
- k-fold cross-validation with threshold tuning for macro-F1, benchmarked against baselines.
- SHAP-based inspection and ROC / PR-curve evaluation.
Screenshots & diagrams
Real UI captures and figures — source is private and client brands are not shown.
Deep dive
The interesting engineering here is less the model choice and more the data plumbing and the objective. The raw inputs arrive as several disjoint files that must be joined correctly before any modelling can happen, and the target metric — macro-F1 — rewards balanced per-class performance. That reframes the problem from "fit a classifier" to "engineer clean features and pick the operating point that maximises balanced F1," which is exactly where the threshold-tuning and cross-validation work paid off.