Customer loyalty in Nigeria’s automotive service sector has become volatile due to digital competition, variable pricing, and shifting satisfaction patterns. Traditional regression models fail to capture the nonlinear links between satisfaction, cost, and loyalty. This study used machine learning algorithms: Random Forest (RF), Support Vector Machine (SVM), and Extreme Gradient Boosting (XGBoost), to predict loyalty using customer satisfaction, service cost, and behavioral indicators from Anaval Mechanic Workshop (January–December 2023). Model performance was evaluated using accuracy and Area Under the Curve (AUC). XGBoost performed best (AUC = 0.985; accuracy = 97.1%), followed by RF (AUC = 0.962) and SVM (AUC = 0.485). Findings confirm satisfaction, cost, and uncertainty as key loyalty drivers, highlighting XGBoost’s superiority in modeling complex satisfaction–cost dynamics