Skip to main content
Back to case studiesData Science / Machine Learning

Lead Score API — a Trained Model, Not a Prompt

Scores inbound leads by conversion likelihood in milliseconds, trained on ~9,200 real leads with measured accuracy — the first project here written in Python instead of TypeScript.

PythonFastAPIscikit-learnpandasVercel
82.2% accuracy, 0.888 ROC-AUC
View Live Demo

The Problem

Everything else here calls an AI API per request — great for unstructured tasks like drafting a reply, wasteful for a decision made thousands of times a day like "is this lead worth a callback." That's a training problem, not a prompting problem.

Our Approach

  • 1Trained a gradient boosting classifier on a real public lead-conversion dataset (~9,200 leads from an online education company's marketing campaigns), deliberately excluding any column a sales rep would only fill in after contact so nothing leaks into the training signal.
  • 2Evaluated it against a logistic regression baseline on a held-out test split before shipping either one, so the reported accuracy is measured, not asserted.
  • 3Served it through FastAPI on Vercel's Python runtime — a genuinely different backend stack from the other five projects, proving the Python/ML toolchain independently of the Next.js one.

What This Achieves

  • 82.2% accuracy and a 0.888 ROC-AUC on a real held-out test set — both reproducible by running the training script fresh, not hand-picked from a lucky run.
  • Scores a lead in milliseconds with zero per-request API cost, versus the latency and price of an LLM call for the same yes/no decision.
  • Pairs directly with the n8n AI Lead Auto-Responder: score first, then only spend an AI-drafted reply on the leads actually worth one.

Share this case study

Next Automation Case Study

WhatsApp AI Support Bot — Real Answers, Real Human Handoff

Have something similar in mind?

Scope Your Project