top of page
AI Buss-35_edited.jpg

with AI Model Optimization

Predicting Purchase Behavior

This project focuses on predicting customer purchase behavior using machine learning models, with an emphasis on feature importance. It will highlight how to implement and optimize predictive models, offering marketers a framework to integrate AI-driven decision-making into their operations.

Overview

According to a recent study by HubSpot, 78% of marketers said their industry had changed more in the past three years than in the preceding five decades. It is easy to see why given an overwhelming majority, 95%, of companies now integrate AI-powered predictive analytics into their marketing strategy. But the reality is while many companies tout the criticality of consumer data, from predicting future purchases to customer churn,

84% of marketing executives report difficulty in making data-driven decisions despite all of the consumer data at their disposal.

- Pecan.ai Predictive Analytics in Marketing Survey

This project aims to guide marketers through the process of building and optimizing predictive models using consumer data to highlight which variables have the greatest impact. It will also showcase actionable insights derived from those models, such as specific customer segments to target or personalized marketing strategies, addressing questions such as:

  • What are the factors influencing customer purchase decisions?

  • What factors contribute most to lead conversion?

  • How can we prioritize high-value leads?

  • How to segment customers based on interests, behavioral attributes, demographics, or stage in the journey?


By bridging the gap between data collection and decision-making, the goal is to empower marketers to confidently integrate AI-driven insights into their day-to-day operations, ultimately improving customer engagement and ROI.

Results, Insights and Next Steps

Optimized Models

The optimized Random Forest Classifier after hyperparameter tuning and SMOTE application, SMOTE model, offers the best balance across all metrics, particularly in recall, F1 score, and ROC AUC. It’s especially suitable for scenarios where identifying positive cases (e.g., customers likely to make a purchase) is crucial. The Stacking Model also performs well but focuses slightly more on precision.

​Feature Importance

The most important predictors of customer purchase behavior are Time Spent on Website, Age, and Discounts Availed. Models that address class imbalance (like SMOTE) tend to place higher importance on discounts and loyalty programs. Understanding these key drivers can help businesses target marketing strategies to improve conversion rates.

  • Time Spent on Website: consistently the most important feature across all models, indicating it is a significant predictor of purchase behavior.

  • Age: consistently ranked as the second most important, highlighting its key role in determining purchasing behavior.

  • Discounts Availed: results suggests that discounts heavily impact purchasing decisions, especially when class imbalance is addressed (SMOTE).

  • Annual Income: shows a moderate impact across all models, suggesting it affects purchasing behavior, but to a lesser extent

  • Number of Purchases: shows lower importance across all models

  • Loyalty Program: has the lowest importance across models, indicating that while it is a factor, it is not a strong determinant of purchasing behavior.

Next Steps for Further Testing

To help refine the model further, ensuring that it is both predictive and useful for business applications, we could perform the following:

  • Additional Hyperparameter Tuning: Explore finer adjustments in the hyperparameters for Random Search and SMOTE models to improve their predictive performance. This includes testing a broader range of values for estimators, max depth, and learning rates.

  • Feature Engineering: Investigate interactions between features (e.g., Age * Time Spent on Website) to improve predictive power.

  • Sensitivity Analysis: Test the models' sensitivity to different ranges of feature values (e.g., high-income versus low-income groups) to better understand how feature importance shifts across different customer segments.

  • Evaluate Different Resampling Techniques: Given the SMOTE model results, it would be beneficial to explore alternatives to SMOTE, such as ADASYN or NearMiss, to handle class imbalance differently and assess the impact on model performance.

  • External Data Sources: If possible, incorporate external data (e.g., social media activity, geographic information) to see if other features improve predictions.

Conclusion

This project successfully predicts customer purchase behavior using optimized machine learning models. The Random Forest model, after hyperparameter tuning and addressing class imbalance, performed the best. The Feature Importance analysis provided actionable insights for marketers.

The interactive dashboard offers a clear way to visualize feature prioritization, helping data scientists and stakeholders make informed decisions in real time. While quick to implement, models require time to fully optimize, and the quality of results depends on the data provided, this project can serve as a model to better understand and implement predictive models for immediate insights. Marketers who embrace predictive modeling will be well-positioned to thrive in the ever evolving landscape.

See Full Project on Github 

Including python notebook file, visualizations, PDF Presentation, ReadMe and more

bottom of page