[BD]

Work & Case Studies

Each case study covers the problem, what I actually decided, and the result, including the results I didn't expect. Smaller projects follow below.

Case Study

FlyRank CTR Opportunity Scoring

  • Python
  • DuckDB
  • Scikit-learn
  • Random Forest
  • Pandas

The Problem

A content reviewer with time for about 50 pages per cycle needs an ordered queue, not 500 unranked candidates. Rankings don't reliably predict clicks: CTR falls unevenly across ranking positions and content types, so a single fixed rule is too rigid.

What I did

I framed it as ranking via binary classification. A page counts as an anomaly if its CTR is below half the median of pages in the same position tier and content type. The model uses five features knowable before review (impressions, average position, content age, word count, engagement rate); I excluded ctr and clicks because ctr is the numerator of the label. I wrote a transparent baseline rule before any model training, then compared Logistic Regression and Random Forest on the same client-holdout split (75/25 by client, seed 42). I used DuckDB on the ~78.8M-row warehouse to verify grain, availability and scale, then modelled on the 30k-row starter slice (22,006 pages with 100+ impressions, 30 clients). Finally I combined model scores with the rule into six reason-coded action archetypes, including a do-not-act group.

What came of it

On 4,610 held-out rows from 8 unseen clients, the Random Forest reached Precision@50 of 0.640 and Precision@20 of 0.850. My hand-written rule scored 0.260 at Precision@50, about chance level (0.286) on unseen clients. A naive random split had reported 0.940 because 26 of 30 clients (87%) appeared in both train and test. I also planted two leaks on purpose to check that the validation harness catches them: reintroducing trend_pct raised in-sample accuracy from 0.6445 to 0.9999 in the warehouse contract stage, and reintroducing ctr raised Precision@50 from 0.640 to 0.980. Both were removed before any reported result.

MethodPrecision@20Precision@50
Random chance0.2860.286
Hand-written rule0.3500.260
Logistic Regression0.5500.480
Random Forest (final)0.8500.640

Same held-out test set for every row: 4,610 rows, 8 clients unseen in training, 28.6% positive rate.

Known limitations

  • The label is a proxy (CTR below peer median), not proof that a page's metadata is broken. About 1 in 3 of the top-50 flags is not a real anomaly.
  • Observational data: nothing here shows that rewriting a title or meta description recovers clicks.
  • All 3 false positives in the top-20 sat near the 100–250 impression floor, where CTR estimates are noisiest.
  • One dataset, one time slice, 8 test clients. 0.640 describes this data and label definition, not a guarantee elsewhere.

Guardrails

  • Never auto-publish a rewritten title or meta description from a model score alone.
  • Never treat a high-confidence tier as proof that a rewrite will recover clicks.
  • Never act on a page below the 100-impression visibility floor.
  • Never bulk-refresh content purely by age; the freshness evidence was mixed.
  • Re-check Precision@50 against 0.640 when new data arrives; a drop below roughly 0.50 pauses the queue.

Next time

Add an impression threshold that scales with the volatility of each position tier to filter out small-sample false positives, and validate the label with a controlled before/after test on real metadata edits.

Bar chart showing Random Forest Feature Importances, led by impressions_90d and engagement_rate
Feature importance is spread across five features (impressions 37%, engagement 25%, position 24%, word count 8%, age 6%), which argues against a hidden leak.

The illusion of 94% accuracy

A naive split looked almost perfect (0.940). The gap to the honest 0.640 is the size of the illusion: the model was partly memorizing client-specific CTR levels instead of learning a pattern that carries to a new client. Reporting the lower number was the most valuable lesson of the project.

Case Study

Customer Churn Risk Intelligence

  • Python
  • Scikit-learn
  • LightGBM
  • MLflow
  • Pandera
  • Pydantic
  • FastAPI
  • Docker
  • GitHub Actions

The Problem

Predicting churn in a notebook isn't enough. Marketing needs actionable risk tiers rather than raw binary flags, and engineering needs a reproducible, containerized pipeline that doesn't silently fail when upstream schemas change.

What I did

I enforced declarative data contracts with Pandera (training) and Pydantic (inference). After feature engineering, I compared a linear baseline against tree ensembles using 5-fold stratified CV, tracking experiments, metrics, and parameters in MLflow.

What came of it

Logistic Regression won with a mean CV ROC-AUC of 0.8501, ahead of Random Forest and LightGBM. I serialized it with Skops and served it from a Dockerized FastAPI service that maps probabilities to four business risk tiers. GitHub Actions, Pytest, Ruff, and Release Please handle testing and versioned releases.

Next time

Add SHAP-based explanations to the API response, and put drift monitoring (e.g. Evidently) in the serving container to compare live payloads against the training baseline.

Bar chart comparing Cross-Validated ROC-AUC across Logistic Regression, Random Forest, and LightGBM
Cross-validated ROC-AUC by model. The linear baseline outperformed the tree ensembles for probability-based risk ranking.

Security vs. convenience (Skops over pickle)

Python `pickle` and `joblib` files can execute arbitrary code if tampered with. I traded the convenience of standard serialization for Skops, which restricts what can be loaded at inference time.

More projects

Systems and from-scratch implementations. Where a project is a learning exercise, I say so.

TabTrace

Reproducible tabular ML pipeline enforcing justified feature engineering and cross-validated evaluation.

  • Rejects 'notebook-only' ML: every stage from ingestion to feature engineering is a pure, unit-tested function.
  • Enforces declarative feature justifications via a custom registry decorator; the pipeline halts if a rationale is missing.
  • Uses deterministic, saved train/val/test splits with explicit leakage checks to ensure honest evaluation.
  • Compares a Logistic Regression baseline against a grid-searched Random Forest using 5-fold cross-validation.
  • Automated CI/CD gating merges with Pytest (>90% coverage enforced), Ruff formatting, and Release Please semantic versioning.
  • Python
  • Scikit-learn
  • Pandas
  • Pytest
  • GitHub Actions

ModelGate

Production-ready, containerized machine learning inference API with zero boilerplate.

  • Dynamic artifact loading: instantly serves Scikit-Learn/Joblib models from local paths or direct HTTP URLs via environment variables.
  • Strict JSON Schema boundary validation that dynamically blocks malformed payloads from ever reaching the inference engine.
  • Robust 'Error Shielding' overrides default exception handlers to prevent raw Python stack traces from leaking to clients, returning safe 422/500 JSON.
  • Fully Docker-native, rigorously tested with Pytest, and enforced by GitHub Actions (Ruff linting, Release Please versioning).
  • FastAPI
  • Docker
  • Python
  • Pytest
  • Scikit-learn
  • GitHub Actions

OverfitLab

Deep learning experiment demonstrating the diagnosis and correction of overfitting.

  • Simulated a classic neural network failure mode (memorizing noise) using a highly non-linear synthetic dataset.
  • Diagnosed train/validation divergence on a deep Multi-Layer Perceptron (MLP) baseline.
  • Restored model generalization by applying Dropout and L2 Weight Decay using PyTorch.
  • Packaged as a reproducible Python module with deterministic data generation and Matplotlib visualizations.
  • Enforced code quality and robustness with Pytest, Ruff, pre-commit hooks, and GitHub Actions.
  • PyTorch
  • Python
  • Scikit-learn
  • Matplotlib
  • Pytest

Aegis Omnisearch Agent

Lightweight RAG agent for resource-constrained deployments.

  • Custom ReAct-style reason-and-act loop using the Gemini API for tool selection and grounded answers.
  • Local retrieval with FAISS and INT8 ONNX Runtime for CPU inference.
  • PDF processing designed around limited memory: page-by-page streaming and micro-batched indexing.
  • GitHub Webhook mechanism for updating the indexed knowledge during deployment.
  • Python
  • Gemini API
  • FAISS
  • ONNX Runtime
  • FastAPI

LexiByte

Byte-Pair Encoding tokenizer implemented from scratch, published on PyPI.

  • GPT-style regex pre-tokenization with Unicode-aware patterns for words, numbers, and punctuation.
  • Frequency dictionary built during BPE training to avoid unnecessary merge checks.
  • Memoization to avoid repeated tokenization work at inference.
  • UTF-8 byte-level fallback so there are no out-of-vocabulary failures.
  • Python
  • BPE
  • PyPI

NanoTransformer & Forge-LM

Transformer implementation, training, and lightweight inference, end to end.

  • NanoTransformer: GPT-2-style decoder written with PyTorch primitives, using my own LexiByte tokenizer, with experiments in FlashAttention and bfloat16 mixed precision.
  • Forge-LM: scaled to ~28M parameters and trained on TinyStories, using gradient accumulation to fit in ~6 GB VRAM.
  • Exported to ONNX with INT8 dynamic quantization, served through a FastAPI + NumPy inference service in Docker, and tested in low-memory environments.

Scope: A learning project on a small dataset. It demonstrates the path from architecture to training to lightweight serving, not state-of-the-art generation quality.

  • PyTorch
  • ONNX
  • INT8 quantization
  • FastAPI
  • Docker

Multimodal Phishing Detection Platform

Phishing detection combining URL structure with linguistic signals.

  • Combined structured URL features (ISCX dataset) with linguistic features (PhiUSIIL dataset).
  • Soft-voting fusion across models; XGBoost with Platt scaling via CalibratedClassifierCV for calibrated probabilities.
  • Exposed through FastAPI with an interactive Streamlit evaluation UI, run with Docker Compose.
  • XGBoost
  • Scikit-learn
  • FastAPI
  • Streamlit
  • Docker Compose

ZeroProp Engine & Live Dashboard

Neural network built without a DL framework, with real-time training visualization.

  • Dense layers, ReLU, and Softmax cross-entropy implemented with NumPy matrix operations, including forward pass, loss, and backpropagation.
  • FastAPI WebSockets stream training metrics to a React + HTML5 Canvas dashboard showing epoch, loss, and accuracy live.

Scope: Built to understand the mechanics, not as a replacement for PyTorch.

  • NumPy
  • FastAPI
  • WebSockets
  • React
  • Canvas

LunarLander-v2 Agent

Reinforcement-learning agent trained with PPO.

  • Trained an agent to land a lunar module on its pad using Proximal Policy Optimization.

Scope: A standard RL benchmark environment, done as a learning exercise.

  • Reinforcement learning
  • PPO
  • Python

All code is public on GitHub.

View Profile