Introduction: Heart disease is known as one of the most important causes of death in today's society and so far no definitive method has been found to predict it and several factors are effective in contracting this disease. Therefore, the aim of this study was to provide a data mining model for predicting heart disease.Material and Methods: This study used standard data from UCI. These data include four Cleveland, Hungarian, Swiss and Long Beach VA databases. These data include 13 independent variables and one dependent variable. The data are missing, and the EM algorithm was used to control this loss, and at the end of the data, a suggestion algorithm was implemented that combined the two random forest algorithms and the artificial neural network.Results: In this study, data was divided into two training sets and 10-Fold method was used. To evaluate the algorithms, three indicators of sensitivity, specificity, accuracy were used and the accuracy of the prediction algorithm for four data Cleveland, Hungarian, Switzerland and Long Beach VA reached 87.65%, 94.37%, 93.45% and 85%, respectively. Then, the proposed algorithm was compared with similar articles in this field, and it was found that this algorithm is more accurate than similar methods.Conclusion: The results of this study showed that by combining the two algorithms of random forest and artificial neural network, a suitable model for predicting heart attacks can be provided.