← All projects

Project 04 · B2B SaaS · Predictive ML

Lead Conversion
Prediction Model

Binary classification model ranking B2B leads by predicted conversion probability — replacing manual priority tiers with a machine-learned probability score from 0 to 100%.

StackPython · scikit-learn · pandas · Random Forest
Roles targetedData Analyst · Data Scientist · RevOps Analyst
ResultRandom Forest AUC 0.648

The Problem

The rule-based lead scoring system in Project 1 assigns priority tiers — Low, Medium, High. But a tier label doesn't tell a sales rep how likely a lead is to convert, only that it should be called before others.

This project replaces tier-based prioritization with a machine learning model that outputs a probability score for each incoming lead, so reps can sort their daily queue by predicted conversion likelihood rather than a manual label.

Dataset

150 B2B leads from the SentinelSec pipeline (28 historical + 122 synthetic to reach modeling scale), each with intake signals and known conversion outcomes.

150Total leads
25.3%Conversion rate
38Closed-Won
2Features used

Key EDA Finding: Multicollinearity

Lead_Score_Cal and Company_Size_Num have a 0.96 correlation — near-perfect collinearity. The scoring formula from Project 1 weights company size at 60/100 points, making the score a mathematical derivative of company size. Using both would feed the model the same information twice.

Decision: Drop Company_Size_Num, keep Lead_Score_Cal (continuous, 51 unique values vs 3 ordinal levels).

FeatureStatusReason
Lead_Score_Cal✓ KeptContinuous, 51 unique values, strong signal
Response_Time_Hours✓ KeptIndependent predictor, real variance
Company_Size_Num✗ Dropped0.96 correlation with Lead_Score_Cal
Business_Hours✗ Dropped0.02 correlation with target
Corporate_Email✗ Dropped148/150 rows identical — no variance

Model Results

Logistic Regression

AUC 0.568

Majority class collapse — predicted zero conversions across the entire test set. A known phenomenon when class imbalance meets limited feature signal.

Random Forest ✓

AUC 0.648

Recommended. Avoids collapse by learning non-linear decision boundaries. Better ranking of converted leads above non-converted ones.

Model evaluation ROC curves and confusion matrices
ROC curves and confusion matrices — Logistic Regression vs Random Forest
Feature importance chart
Feature importance — Lead_Score_Cal dominates at 56.3%

Feature Insights

Lead_Score_Cal — 56.3% importance

The ML model independently confirmed the same signal the rule-based scoring system weighted most heavily in Project 1 — without being told the scoring formula. This cross-validates both approaches through entirely different methodologies.

Response_Time_Hours — 43.7% importance

Negative coefficient in Logistic Regression — longer wait times decrease conversion probability. This provides data-backed evidence for the 24-hour SLA target built in Project 1.

The Output: Ranked Priority Queue

The model scores every lead by predicted conversion probability. A sales rep opening their dashboard each morning sorts by this column — highest probability first — and calls accordingly. No manual judgment required.

#CompanySizeScoreConversion Probability
1Mint Technologies200+8656.1%
2Quark Industries200+8855.1%
3BioPharma Labs200+9055.0%
4Prism Pro200+8754.2%
5Wraith Technologies200+9553.4%

Top 5 of 10 shown. All 200+ enterprise accounts with lead scores 86–95.

Honest Assessment

Trained on 150 leads with a 30-row test set. Methodology is sound; scale is portfolio-appropriate. A production deployment would require 300–500 historical conversions and monthly retraining as new outcomes accumulate. The pipeline supports this with minimal code changes.

The Logistic Regression collapse is documented transparently — it demonstrates understanding of model behavior on imbalanced data, not a flaw in the approach.