Machine Learning-Based Heart Disease Prediction System Using Random Forest Classifier in a Django Web Framework
DOI:
https://doi.org/10.62643/Keywords:
Heart Disease Prediction, Machine Learning, Random Forest Classifier, Django Web Application, Clinical Data Analysis, Health Informatics, Medical Decision Support System, Data Mining, Classification ModelsAbstract
Heart disease remains one of the leading causes of mortality worldwide, making early diagnosis
critical in reducing complications and saving lives. Traditional diagnostic procedures often
involve manual assessment, clinical expertise, and time-consuming evaluations. With the rapid
advancement of machine learning and digital health technologies, predictive models have
emerged as effective tools for supporting clinical decisions. This project presents a Machine
Learning-Based Heart Disease Prediction System implemented using a Django web framework
and a Random Forest Classifier. The system aims to classify whether an individual is at risk of
heart disease based on key clinical attributes.
The proposed system uses a dataset containing 13 medical parameters commonly associated with
cardiovascular health, including age, sex, chest pain type, resting blood pressure, cholesterol
level, fasting blood sugar, resting ECG results, maximum heart rate, exercise-induced angina, ST
depression, slope, major vessels count, and thalassemia status. These features are used as
predictive inputs to the Random Forest model. The system preprocesses the dataset using NumPy
and pandas, handles missing values using nan_to_num, and trains the classifier to generate
accurate predictions.
The Random Forest algorithm is selected due to its ability to handle nonlinear relationships,
reduce overfitting, manage missing values, and provide high classification accuracy. With 16
estimators, entropy criterion, and a maximum depth of 9, the model achieves reliable performance
for the given training dataset. The Django-based interface allows users to input clinical values
through a form, which is validated and processed on the server to generate real-time predictions.
The system outputs whether the user “has” or “does not have” heart disease based on the model’s
prediction.
Downloads
Published
Issue
Section
License

This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License.













