Skip to main content
The model outputs predictions in three distinct classes, each with an associated probability score. Understanding these outputs is crucial for effective lead prioritization.

Predicted Classes

The model categorizes leads into three classes based on historical conversion patterns:
# From train_model.py:129-133
mapping = {0: 'Closed Lost', 1: 'Closed Won', 2: 'Other'}

Class Definitions

Closed Won

Leads predicted to convert successfully. These are high-priority prospects with strong conversion signals.

Closed Lost

Leads predicted not to convert. These may require different engagement strategies or deprioritization.

Other

Leads with uncertain outcomes. These may still be in progress or require additional nurturing.

Color Coding

The dashboard uses a consistent color scheme to visually distinguish predicted classes:
# From aux.py:24-32
def get_label_columns(table_data: pd.DataFrame) -> Dict:
    return {
        'Predicted Class': {
            ("Closed Won"): '#20C69E',   # Green
            ("Closed Lost"): '#F86C7D',  # Red
            ("Other"): '#F2BB67',        # Yellow
        },
    }
  • Green (#20C69E): Closed Won - High priority
  • Red (#F86C7D): Closed Lost - Low priority
  • Yellow (#F2BB67): Other - Medium priority

Probability Scores

Each prediction includes a probability score indicating the model’s confidence in a “Closed Won” outcome.

Probability Binning

Probabilities are grouped into four quartiles for distribution analysis:
# From train_model.py:149-150
probability_bins = pd.cut(
    impact_df['Probability Closed-Won'], 
    bins=[0, 0.25, 0.5, 0.75, 1.0], 
    labels=['25%', '50%', '75%', '100%']
)
probability_distribution = probability_bins.value_counts().sort_index()
Very Low Confidence - Leads in this range are unlikely to convert. Consider deprioritizing or using alternative engagement strategies.
Low-Medium Confidence - These leads show some potential but may need additional nurturing or qualification.
Medium-High Confidence - Solid prospects that warrant active engagement and follow-up.
High Confidence - Top-priority leads with strong conversion signals. Allocate maximum sales resources to these prospects.

Using Predictions for Lead Prioritization

1

Sort by Predicted Class

Focus first on leads classified as “Closed Won” (green labels).
2

Rank by Probability

Within each class, prioritize leads with higher probability scores (closer to 100%).
3

Analyze Contributing Factors

Review the lead features (Use Case, Source, Discount code, etc.) to understand why certain leads scored higher.
4

Allocate Resources

Direct sales efforts toward high-probability “Closed Won” leads for maximum conversion efficiency.
The model calculates probabilities using predict_proba() from the Gradient Boosting classifier, which provides calibrated probability estimates based on the training data.

Prediction Output Structure

The complete prediction output includes:
# From train_model.py:187-192
data = {
    "predictions_df": predictions_df,
    "probability_distribution": probability_distribution,
    "accuracy_score": accuracy_score(y_test, y_pred),
}
  • predictions_df: Individual lead predictions with features and classes
  • probability_distribution: Aggregated count of leads in each probability quartile
  • accuracy_score: Overall model performance metric
Review the accuracy score to understand the model’s reliability. Higher accuracy (closer to 1.0) indicates more trustworthy predictions.

Build docs developers (and LLMs) love