Sub topic 6
CRM: Scoring Leads and Opportunities
This chapter assumes you know what a contact record, a campaign, and a CRM pipeline are. It also assumes you have a basic idea of what machine learning is. You do not need to know any statistics beyond "a probability is a number between 0 and 1."
What a score is
Lead scoring ranks leads by how likely they are to reach a goal, usually becoming a customer. Opportunity scoring does the same for deals already in the pipeline, usually to estimate the chance of closing. Both are predictive features. A model learns from past records whose outcome is known and returns a probability for a new record.
There are two common approaches:
| Approach | How the score is built | Typical weakness |
|---|---|---|
| Rule-based | People assign points, for example +20 for requesting a demo | Weights are guesses and go stale |
| Predictive | A model learns weights from past outcomes | Needs enough clean history |
Many platforms label both as "AI scoring." Check which one you are getting.
How the model is produced
The platform builds features from CRM and engagement data: demo requests, email domain type, pricing page views, company size, and recent activity. The label is the known outcome, such as "became a customer" or "did not." The loop at the end matters because new outcomes become new training data.
A minimal example
The code below trains on six past leads and scores a new one. Real platforms use far more data, but the idea is the same.
import numpy as np
from sklearn.linear_model import LogisticRegression
# Columns: requested_demo, free_email_domain, pricing_page_views
X = np.array([
[1, 0, 3],
[0, 1, 0],
[1, 1, 5],
[0, 0, 1],
[1, 0, 4],
[0, 1, 0],
])
# 1 = lead became a customer, 0 = it did not
y = np.array([1, 0, 1, 0, 1, 0])
model = LogisticRegression().fit(X, y)
new_lead = np.array([[1, 0, 2]])
score = model.predict_proba(new_lead)[0, 1]
print(f"Conversion probability: {score:.2f}")predict_proba returns one probability per class. Index [0, 1] selects the first row and the "became a customer" class. Platforms often convert this probability into a 0 to 100 score or into labels such as hot, warm, and cold.
Common errors
- Too little history. With a few dozen conversions, a model learns noise. Many platforms require a minimum number of won and lost records before predictive scoring turns on.
- Label leakage. If a feature is only filled in after the outcome, such as "contract sent," the model looks accurate in testing and fails on new leads.
- Bias from past behavior. If sales only called leads from certain regions, the model learns that those regions convert, because the others were never tried.
- Treating the score as a probability. A score of 80 may mean "ranks high," not "80% will buy." Check calibration against actual results.
- Stale models. Pricing, products, and markets change. Scores need retraining and periodic review.
- Poor data capture. Duplicates and missing activity records weaken every feature the model uses.
Using scores well
Set a threshold with sales, not alone. A cutoff that sends too many leads to sales wastes their time. A cutoff that is too strict hides real buyers. Review a sample of low-scored leads that later converted, since they show where the model is blind. To judge whether scoring helps at all, compare it with a baseline such as the old rules or random ordering, which later chapters cover.
Exercise
A new predictive scoring feature shows 98% accuracy in testing, but sales reports it performs poorly on live leads. One input feature is "contract sent date." What is the likely problem, and how do you fix it?
Show answer
Label leakage. "Contract sent date" is only filled in late in the deal, so it reveals the outcome and does not predict it. The model looks accurate on past data but has no such value for new leads. Remove the feature, retrain using only information available at the time the lead is scored, and test again on recent leads.
Exercise
Why can a model trained only on leads that sales chose to call give biased scores?
Show answer
The training data shows outcomes only for leads that were contacted. Leads that were never called have no outcome, so the model cannot learn whether they would have converted, and it favors the kinds of leads sales already preferred.