Purpose Live-streaming platforms emphasize dynamic social interaction and fan engagement. Users integrate into the live-streaming community through continuous social learning activities, such as sending bullet comments, reviewing comments and interacting with celebrities. However, comprehensive research on the transactional intricacies of live-streaming e-commerce from the perspectives of community and learning is still lacking. Design/methodology/approach Focusing on the behavior characteristics of the reference group represented by online celebrities and fans in the live-streaming environment, this study utilized social learning as the theoretical basis to examine how reference groups affect consumer purchase intention through a series of intermediary effects. An empirical investigation and machine learning algorithms were utilized to explore and verify the hypothesized model. Findings The results show that: (1) reference groups’ behavior positively stimulated social presence and enhanced consumer purchase intention through the chain-mediating effect of social presence and trust in online celebrities; (2) celebrity characteristics (professionalism, attractiveness and interactivity) positively impacted consumer trust; (3) in addition, machine learning algorithms substantiated that reference groups’ behavior, social presence, trust and celebrity characteristics had a remarkably robust predictive effect on purchase intention. Originality/value These findings hold theoretical implications for understanding how the social community affects consumers’ purchase intention in the live-streaming context and practical significance for marketing strategies toward live-streaming e-commerce.