Index of Contents
Chapter 1: Introduction
1.1 What is coronary heart disease.........................................................................................................1-2
1.2 Abstract of work 3
Chapter 2 : Profile of the Area/Organization
2.1 Details of Organization .......................................................................................................................4
2.2 Nature of Activity/ Service 4
Chapter 3 : Methodology / work plan
3.1 Objective.............................................................................................................................................5
3.2 Planning and Data Preprocessing/Execution ................................................................................5-10
Chapter 4 : Work done / Activities Performed
4.1 GUI implementation ...................................................................................................................11-14
Chapter 5 : Observation and Finding / Learning Outcomes
5.1 Literature Outcome 15-17
Chapter 6 : Challenges and Solution
6.1 Problem Detection 18
6.2 Heart disease data collection 18-21
Chapter 7 : Conclusion and Suggestions……………………………………21
Final Section: Annexures(Geo tag Photographs ,Survey Forms/Questions,
Activity log/ daily dairy, supporting documents)
………………………………………………………………...22-25
Bibliography/References……………………………………………………..26
0
[Link]
The Heart is one of the most important organs in the human body. It is the
centre of the circulatory system. The heart functions as a pump that propels
blood to different parts of the human body through a network of blood vessels,
supplying a constant supply of oxygen as well as other vital nutritional
components. If the heart ever stops functioning and ceases to pump blood, the
body will shut down and within very less time a person will expire.
1.1 What iscoronary heart disease?
Coronary heart disease (CHD) is also called as coronary artery [Link]
coronary arteries are the blood vessels that carry
blood to your heart. Coronary artery disease is
the narrowing or blockage of the coronary
arteries. This condition is usually caused by
atherosclerosis. Atherosclerosis
is the build-up of cholesterol and fatty deposits
(called plaques) inside the arteries. These
plaques can clog the arteries or damage the arteries, which limits or stops blood
flow to the heart muscle.
If the heart does not get enough blood, it
cannot get the oxygen and nutrients it
needs to work properly. This can cause
chest pain (angina) or a heart attack.
Coronary artery disease (CAD) is the
most common type of heart disease
in the United States. It is sometimes called
ischemic heart disease.
Causes
Coronary artery disease is thought to begin with damage or injury to the inner
layer of a coronary artery, sometimes as early as childhood. The damage may be
caused by various factors, including:
1
Smoking
High blood pressure
High cholesterol
Diabetes or insulin resistance
Not being active (sedentary lifestyle)
Once the inner wall of an artery is damaged, fatty deposits (plaque) made of
cholesterol and other cellular waste products tend to collect at the site of injury.
This process is called atherosclerosis. If the plaque surface breaks or ruptures,
blood cells called platelets clump together at the site to try to repair the artery.
This clump can block the artery, leading to a heart attack.
Symptoms
An acute coronary event, such as a heart attack, may cause the following
symptoms:
• Cold sweats
• Dizziness
• Light-headedness
• Nausea or a feeling of indigestion
• Neck pain
• Shortness of breath, especially with activity
• Sleep disturbances
• Weakness
1.2 ABSTRACT:
Heart disease is one of the most significant causes of mortality in the
world today. Prediction of cardiovascular disease is a critical challenge in
the area of clinical data analysis. The diagnosis of heart disease through
traditional medical history has been considered as not reliable in many
aspects. The health care industry produces a huge amount of data and
these data is not always made use to the full extent and is often
underutilized. Using this huge amount of data, a disease can be detected,
predicted or even [Link] this project, we have developed a Machine
Learning based diagnosis system for heart disease prediction by taking
2
the help of medical data such as Blood pressure, cholesterol, body mass
index, smoking habit, heart rate etc as input and then these features are
modelled for prediction. This model can then be used to predict future
medical [Link] we perform the comparative analysis of the algorithms
like decision tree, Naïve Bayes, Logistic Regression,
[Link] the accuracy of the model using each of the
algorithms will be calculated and the one having the best accuracy will be
taken as the model of predicting the heart disease and finally a GUI will
be designed to predict the disease.
• Tools used: -Anaconda Framework
• Editor: -Jupiter Notebook
• Packages Used: -Pandas, numpy, matplotlib, seaborn, sklearn, sktinker
3
2he Area/Organization
2.1 Details of the Organization
The foundational data collection, analytical benchmarking, and deployment
testing
Operations were executed under the supervision of PYTHONSOFT LLP
Advanced Data Analytics Division.
PYTHONSOFT is a premier software training institute in India dedicated to
providing high-quality training for students.
PYTHONSOFT is an established technical research and educational
institute specializing in engineering analytics, machine learning workflows, and
behavioural computing. The facility provides an ecosystem where data science
paradigms are translated into production-grade software applications targeting
socio-educational challenges.
2.2 Nature of Activities/service
Professional Software Training:
This is their core focus. They provide both online and offline training programs
covering programming languages and advanced technologies, including Python
(Core and Advanced), Java, Data Science, Machine Learning, Deep Learning,
DevOps, and Full Stack Development (Java, Python, and Data Science).
They cater to students and professionals with a curriculum that balances
conceptual theory with practical, project-based learning.
Software Development Services:
Beyond training, they offer development solutions, which include:
Web Design & Development: Building scalable and user-friendly web
applications.
Project Work: Providing hands-on project support as part of their course
offerings and service portfolio.
4
[Link] / Work Plan
Exploratory DataAnalysis
Split data set
Training (80%) Testing (20%)
Algorithms PERFORMANCE EVALUATION
LR Accuracy and F1 Score
KNN
DT
SVM
NB
RF
Best Algorithm
Make Prediction
5
3.1 Objective:
Heart problems have gained a lot of interest in medical research because of
their impact on human health where early diagnosis is critical to delaying
the development of heart disease, the world's leading cause of death. thus, it
is much needed to predict the possibility of occurrence of heart disease
based on their attributes.
This research aims into a variety of machine learning classification
algorithms for predicting heart disease using Framingham dataset.
3.2 Planning and Data Preprocessing/Execution:
Data preprocessing is a group of techniques that are applied on the data to
improve the quality of the data. Raw data can be converted to useful [Link]
uses various techniques such as handling missing values, detecting outliers,
removing un wanted attributes etc.
Once data is cleaned then it can be used in machine learning models for
training. Data preprocessing is one of the most important steps involved in
predictive modelling.
Steps followed in data preprocessing
Education column is removed as it has no relation with heart disease
Most corelated features are found by using correlation matrix(heatmap).
Sysbp and Diabp are highly corelated
Current smoker and Cigsperday are highly [Link] only one of them is
selected.
Missing values are handled by imputation .
Outliers found and removed.
Duplicated rows removed.
Features have been standardized by using Standard Scaler .
6
Explarotery analysis:
Exploratory Data Analysis (EDA) is an approach to analyse the data using
visual techniques. It is used to discover trends, patterns, or to check assumptions
with the help of statistical summary and graphical representations.
Corelation Matrix :
Corelation Matrix is used to show the relationship among the features. It is
shown by heatmap
(Heat Map)
Bar Chart showing Number of People Suffer From heart disease:
7
Pie Chart showning percentage of people with and wit out heart
disease
Pie chart showing male and female percentage
8
Male and Female having disease or not
9
Splitting dataset
Data set is splitted into training and testing subsets .
For training 80% data and for testing 20% of data is selected .
3.3 Tools and techniques used :
For building machine learning model following algorithms
Are used.
• Tools used: -Anaconda Framework, Machine learning
• Editor: -Jupiter Notebook
• Packages Used: -Pandas, numpy, matplotlib, seaborn, sklearn, sktinker
Anaconda (python 3.9)
Python Packages to be installed
• pandas- used to provide fast, flexible and expressive data structures to
make working with “relational” or “labeled” data both easy and intuitive.
• numpy: To work with arrays
• tkinter- used for developing Graphical User Interface (GUI).
• sklearn- efficient for data mining and data analysis. It contains a number
of algorithms which can be implemented directly when required.
• matplotlib- contains modules which are used for plotting graphs.
• Seaborn – used for Graphical Presentation
• Algorithms are-
[Link] Neighbors
[Link] Regressions
[Link] Tree
[Link] Bayes
[Link] Vector Machine
[Link] Forest
10
4. Work Done / Activities Performed
Performance Evaluation Criteria
Commonly, the performance of ML prediction systems is frequently assessed
using metrics based on the classification algorithm. The accuracy, confusion
matrix, and F-measure are used to evaluate the prediction findings in this
research.
11
Logistic Regression
Naive bayes
12
Decision Trees
K-Nearest Neighbor
Support Vector Mach.
13
Random Forest
14
4.1 GUI Implementation
A GUI is developed in python by using tkinter package to generate a
simple interface which takes input for all the values necessary for
evaluation. After the input is taken from the user, prompt appears
which decides whether a person has a presence of heart disease or not.
5. OBSERVATIONS, FINDINGS AND LEARNING
OUTCOMES:
15
Accuracy of Logistic Regression:
16
17
5.1 Literature Outcomes:
Current approaches To predict heart disease
1. Heart Disease Prediction Using Machine Learning and Data Mining
Techniques: Application of Framingham [Link] Journal of
Computer and Mathematics [Link].12 No.14(2021), 4864-
[Link] Adel Mahmoud , Prof. Dr. Mohamed Aborizka ,Prof. Dr. Fathy
Ahmed Elsayed Amer2
In this research work The 10-fold cross-validation resampling is used to
validate the prediction model. 5 different machine learning algorithms
(KNearestNeighbors,LogisticRegression,decisionTree,Random Forest and
support vector machine )are used in this work. Accuracy scores of each
algorithm are evaluated.
KNearestNeighbors-83.95 %
SupportVectorMachine-84.5 %
DecisionTree-84.82 %
LogisticRegression-84.89 %
RandomForest-85.05 %
The RandomForest algorithm is found to have highest accuracy.
Remark
In this approach the features are not standardized .
18
6. Challenges and Solutions:
6.1 Problem Detection
Task definition
In this project the task is to predict whether a person is going to have coronary
heart disease or not in upcoming 10 years by using 6 popular machine learning
algorithms. These are logistic regression, K Nearest neighbours, Naïve bayes ,
Decision tree ,Support vector machine and random Forest algorithm. After
implementing these algorithms, the best model will be found for heart disease
prediction. A graphical user interface will be designed for to make prediction
for new dataset.
6.2 Heart disease data collection
This dataset is located at Kagglewebsite. The dataset contains 16 attributes in
all, of which 15 are independent factors and one variable i.e., TenYearCHDis
the dependent variable or target variable. This data set contains total 4240
[Link] attributes in data set are numeric.
19
The 16 attributes that are defined here are as follows
Demographic:
Sex: male or female (1-male and 0-female)
Age: Age of the patient;(Continuous - Although the recorded ages have
been truncated to whole numbers, the concept of age is continuous)
Education: no further information provided
Behavioural:
Current Smoker: whether or not the patient is a current smoker
(Nominal)
Cigs Per Day: the number of cigarettes that the person smoked on average
in one day (can be considered continuous as one can have any number of
cigarettes, even half a cigarette.)
Information on medical history:
BP Meds: whether or not the patient was on blood pressure medication
(Nominal)
Prevalent Stroke: whether or not the patient had previously had a stroke
(Nominal)
20
Prevalent Hyp: whether or not the patient was hypertensive (Nominal)
Diabetes: whether or not the patient had diabetes (Nominal)
Information on current medical condition:
Tot Chol: total cholesterol level (Continuous)
Sys BP: systolic blood pressure (Continuous)
Dia BP: diastolic blood pressure (Continuous)
BMI: Body Mass Index (Continuous)
Heart Rate: heart rate (Continuous - In medical research, variables such
as heart rate though in fact discrete, yet are considered continuous
because of large number of possible values.)
Glucose: glucose level (Continuous)
Target variable to predict:
10year risk of coronary heart disease (CHD) - (binary: “1”, means “Yes”,
“0” means “No”)
Attribute & description
Age (32-70)
Sex 0=Female, 1=Male
Education It takes values as:
1=High School,
2=High School or GED,
3=College or Vocational School, 4=College
Current 0=No
Smoker 1=Yes
Cigs Per Day Number of Cigarettes smoked Per Day (0-70)
BP Meds 0=No
1=Yes
Prevalent 0=No
Stroke 1=Yes
Prevalent Hyp 0=No
1=Yes
21
Diabetes 0=No
1=Yes
Tot Chol Serum Cholesterol (107-696) (mg/dl)
Sys BP (83.5-295) (mm/hg)
Día BP (48-142.5) (mm/hg)
Body Mass (15.54-56.8)
Index
Heart Rate Heart Rate achieved (44-143)
Glucose (40-394) (mg/dl)
10-year CHD 0=Healthy, 1=Diseases
7. Conclusion :
• In this project six different machine learning algorithms are applied for
prediction of heart disease.
• They are LogisticRegression,K-nearest Neighbours,Naïve Bayes,
Decision Tree, Random Forest and SVM .
• Accuracy of Logistic Regression is 86.26%,K-nearest Neighbours is
85.42%,Naïve Bayes is 83.63%, Decision Tree is 83.03%, Random forest
is 86.14% and SVM is 85.9%.
• From the above we conclude that Logistic Regression is the best model
for coronary heart disease prediction.
Suggestions /Future work:
• In this project 6 machine learning algorithms are applied for
prediction of coronary heart disease .It was found that Logistic
Regressionperforms better than other algorithms. Also a GUI is
developed for prediction of heart disease. In future artificial
neural networks algorithms will be used to get better accuracy.
Also a web based system will be developed so that people from
different parts of world can use it.
22
Health Survey Forms
Respondent Details:
[Link].1 Survey Question| Answer
1. Name of the Person- Aswini Behera
2. Age- 45 Years
3. Number of Cigarettes Smoked per Day- 5
4. Does the Person Have Diabetes?- Yes (1)
5. Blood Pressure (BP) - 140 mmHg
6. Heart Rate - 90 bpm
7. Taking BP Medicine? -Yes (1)
8. Has Hypertension? - Yes (1)
9. Cholesterol Level - 285 mg/dL
10. Body Mass Index (BMI) - 34
11. Blood Glucose Level - 200 mg/dL
Risk Status: High Risk for Heart Disease
Conclusion:
The respondent is at high risk of developing heart disease due to the presence of
multiple cardiovascular risk factors. Immediate medical consultation is
recommended for proper evaluation and management.
[Link].2 Survey Question| Answer
1. Name of the Person- Kailas Biswal
2. Age- 36 Years
3. Number of Cigarettes Smoked per Day- 0
4. Does the Person Have Diabetes?- Yes (0)
5. Blood Pressure (BP) - 120 mmHg
6. Heart Rate - 85 bpm
7. Taking BP Medicine? -Yes (0)
8. Has Hypertension?- Yes (0)
23
9. Cholesterol Level - 100 mg/dL
10. Body Mass Index (BMI)- 34
11. Blood Glucose Level- 80 mg/dL
Risk Status: Low Risk for Heart Disease
Survey Summary:
Typically maintain healthy blood pressure, optimal cholesterol levels, and
normal blood sugar. They engage in regular physical activity, do not smoke, and
maintain a healthy weight.
24
Final Section
Geo tag Photograph:
25
26
References:
[1] Heart Disease Prediction Using Machine Learning and Data Mining Techniques:
Application of Framingham [Link] Journal of Computer and Mathematics
[Link].12 No.14(2021), 4864- [Link] Adel Mahmoud , Prof. Dr.
Mohamed Aborizka ,Prof. Dr. Fathy Ahmed Elsayed Amer2 .
[2] [Link],”Predictionofheartdiseaseusingmultilayerperceptronneuraln
etwork,”InternationalConferenceonInformationCommunicationandEmbeddedSystems(I
CICES2014),pp.1–6,Feb,[Link].1109/ICICES.2014.7033860.
[3] S. A. Pattekari and A. Parveen, ”Prediction system for heart diseaseusing Naive
Bayes,” International Journal of Advanced Computer
andMathematicalSciences,vol.3,no.3,pp.290–294,2012.
[4] K. H. Miao, J. H. Miao, and G. J. Miao, ”Diagnosing Coronary Heart Disease Using
Ensemble Machine Learning,” (IJACSA)
InternationalJournalofAdvancedComputerScienceandApplications,vol.7,no.10,pp.30–
39,[Link].14569/IJACSA.2016.071004.
[5] K. H. Miao and J. H. Miao, ”Coronary Heart Disease Diagnosis using Deep Neural
Networks,” (IJACSA) International Journal of Advanced Computer Science and
Applications, vol. 9, no. 10, pp. 1-8, 2018. doi:10.14569/IJACSA.2018.091001.
[6] [Link],[Link],[Link],”Effectivediagnosisofheartdiseasethroughneuralnetwor
ksensembles,”ExpertSystemswithApplications,vol.36,no.4,pp.7675–
7680,May,[Link]:[Link]
[7] S. Bashir, U. Qamar, F. H. Khan, and M. Y. Javed, ”An Efficient Rule-Based
Classification of Diabetes Using ID3, C4.5, & CART Ensem-
bles,”in201412thInternationalConferenceonFrontiersofInformationTechnology,pp.226–
231,[Link].1109/FIT.2014.50.
[8] T. Panch, P. Szolovits, and R. Atun, ”Artificial intelligence, machine learning and
health systems,” Journal of Global Health, vol. 8,
[Link]:doi:10.7189/jogh.08.020303.
[9] [Link],”MachineLearninginMedicalApplica-tions,” Machine
Learning and Its Applications, vol. 2049, pp.
300–307,[Link]:[Link]
[10] S. A. Alasadi and W. Bhaya , ”Review of data preprocessing techniquesin data
mining,” Journal of Engineering and Applied Sciences, vol. 12,no.16,pp.4102–
4107,Sep2017.
27