Cardiovascular diseases (CVDs) are the most common cause of death in the world. Over four out of five CVD deaths are due to heart attacks and strokes. CVD high mortality has led to about 17 million deaths worldwide. Several machine and deep learning techniques are used to classify the presence and absence of CVD. This paper presents a logistic regression (LR) technique for predicting the risk of heart diseases (HD). The goal is to create an LR algorithm and build a prediction model that would foretell the development of HD. The dataset included data on 207 patients, featuring the following: age, sex, chest pain type, blood pressure, cholesterol levels, fasting blood sugar > 120 mg/dl, electrocardiogram results, maximum heart rate, exercise-induced angina, ST depression, slope of the ST segment, number of major vessels colored by fluoroscopy, and thallium scan results. Using this dataset to train the LR technique, a robust model was created to accurately predict the existence of HD in new patients. With an accuracy of 81%, a precision of 83%, and a recall score of 76%, the accuracy, precision, and recall key metrics were used to evaluate the model's efficacy. The model’s accuracy was compared to alternative methods, such as K-Nearest Neighbors and Decision Tree classifiers, which yielded accuracy of 81% and 76%, respectively. The obtained results are of great significance for healthcare providers – the proposed model can assist in identifying those who are at high risk of heart diseases and allow for early implementation of prophylactic...