In recent years, machine learning has highlighted good results in the early diagnosis and prediction of diseases. Stroke is a serious threat to human health. Early prediction of stroke is of great significance for treatment and intervention. This paper mainly investigates the application of different machine learning models in stroke prediction and compares the performance of each model. First, we collected some data, which contained 5110 entries or records and 12 different attributes. The dataset was then subjected to various preprocessing measures, such as eliminating data redundancy. Seven different machine learning models were used. Includes Logistic Regression, Support Vector Classifier (SVC, K-Neighbors Classifier, Decision Tree Classifier, Random Forest Classifier, XGBoost Classifier (XGBClassifier) and Deep Neural Networks (DNN). After model comparison, we found that when the dataset was extremely imbalanced, the AUC of DNN before feature selection was 82%, which was significantly better than other machine learning models. In addition, the characteristics of each model were analyzed to provide a reference for the selection of stroke prediction models. The results of this study provide value for the early diagnosis and intervention of stroke, and also provide new ideas for the application of machine learning algorithms in the field of stroke prediction.