In this paper, based on the machine learning algorithm of psychological education and civic education research, the decision tree algorithm and gradient enhancement tree are used, and then construct the crisis early warning model of the integration of civic education and psychological education teaching are constructed. According to the requirements of psychological education and ideological education in colleges and universities for the cultivation of students’ college students’ emotional regulation ability, the model can be divided into four layers for research. Combining the research objectives and hypotheses, the research on the path of integrating the teaching of college psychology and Civics with machine learning is designed. The questionnaire is designed and distributed to obtain research data, and statistical analysis is used to empirically analyze the integrated teaching of college psychology and Civic and Political education in the context of the Internet. The results show that in the model analysis, after suffering from positive stimuli at the moment of t=3, the intensity of positive emotions gradually increased, and the intensity of negative emotions gradually decreased, and the model accurately reflected the emotional changes of college students when suffering from stressful events. On the statistical analysis of the teaching path, the correlation coefficients were 0.948, 0.935, 0.942, 0.905, and 0.827, and the strongest correlation was found between the sense of acquisition of Civic and Political knowledge and the sense of acquisition of integrated teaching of Psychological Education and Civic and Political Education. This study gives full play to the maximum value of the infiltration of the contents of Civic and Political Education and Psychological Education, which is of great significance to the cultivation of college students’ emotional regulation ability.