Abstract
Lead scoring is an essential process in sales and marketing that prioritizes prospective customers based on their potential to convert. In this study, we present a robust machine learning framework for lead scoring using the publicly available X Education dataset, which comprises 9240 leads described by 37 diverse features including online behavior, engagement metrics, and demographic details. Our approach begins with thorough data preprocessing removing irrelevant identifiers, handling missing values, and converting categorical variables followed by normalization and dimensionality reduction using Principal Component Analysis (PCA). We evaluated several PCA configurations (with 3–30 components) to capture the intrinsic variance in the dataset. Four classifiers, namely K-Nearest Neighbors (KNN), Support Vector Machine (SVM), Decision Tree, and Random Forest, were then trained with optimal hyperparameters determined through GridSearchCV and stratified cross validation. Specifically, KNN achieved its best performance with 15 principal components and n_neighbors=9, while SVM attained an accuracy of 91.8% at 25 components with C=10, γ=0.01, and an RBF kernel. The Decision Tree and Random Forest models also demonstrated competitive results. Moreover, ensemble methods—namely a soft voting ensemble and a stacking ensemble using Logistic Regression as a meta-classifier—were implemented to integrate the strengths of individual models. The stacking ensemble delivered the highest performance, with an overall accuracy of 92% and an AUC of 0.967. This study underscores the potential of machine learning, particularly ensemble approaches, to significantly enhance the precision of lead scoring and thereby optimize resource allocation in marketing strategies.