This research aims to investigate the causal factors influencing consumer purchasing behavior on online platforms, anddevelop a consumer decision-making model using Machine Learning techniques within the Stimulus–Organism–Response (S–O–R) theoretical framework. The study utilized a dataset comprising 1,061 authentic product reviews collected from Shopee, Lazada, and TikTok Shop platforms, assessed through Natural Language Processing (NLP) using PyThaiNLP, and analyzed the classification by employing three machine learning algorithms: Decision Tree, Na?ve Bayes, and k-Nearest Neighbors (k-NN). The findings revealed that the Decision Tree algorithm demonstrated superior performance, achieving an accuracy of 89.15%, precision of 89.54%, recall of 89.61%, and F-measure of 89.57%. The model effectively explained consumer behavior in accordancewith the S–O–R framework components: Stimulus, Organism, and Response. The results indicate that machine learning techniques can accurately analyze consumer behavior patterns and provide significant insights for developing digital marketing strategies to enhance consumer experience and satisfaction.