0% found this document useful (0 votes)
77 views14 pages

PWP MP

The chatbot can be further improved by adding more patterns to handle a wider range of questions. Integrating with knowledge graphs and unstructured medical text can enhance its capabilities. Mobile Applications: Developing mobile apps based on the prediction system can empower patients to monitor their health from home and seek timely care. The opportunities are immense to leverage machine learning and healthcare data to revolutionize disease management and improve patient outcomes. Continued research in this direction holds great promise for transforming preventive cardiology and precision medicine. 12 CONCLUSION In this project, we developed a machine learning-based heart disease prediction system implemented in Python. By analyzing a comprehensive patient dataset, we were able

Uploaded by

umbrajkarsneha
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
77 views14 pages

PWP MP

The chatbot can be further improved by adding more patterns to handle a wider range of questions. Integrating with knowledge graphs and unstructured medical text can enhance its capabilities. Mobile Applications: Developing mobile apps based on the prediction system can empower patients to monitor their health from home and seek timely care. The opportunities are immense to leverage machine learning and healthcare data to revolutionize disease management and improve patient outcomes. Continued research in this direction holds great promise for transforming preventive cardiology and precision medicine. 12 CONCLUSION In this project, we developed a machine learning-based heart disease prediction system implemented in Python. By analyzing a comprehensive patient dataset, we were able

Uploaded by

umbrajkarsneha
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 14

Maharashtra Board of Technical Education,

Mumbai

GOVERNMENT POLYTECHNIC, SOLAPUR

DIPLOMA IN COMPUTER TECHNOLOGY


ACADEMIC YEAR 2021-22

Programming with Python

MICRO-PROJECT

ON

Heart Disease prediction using Machine Learning in


Python

Submitted by:
04 – Sneha Umbrajkar

31 – Sayali Kshirsagar

Submitted to:
Prof. Imalata Kurapati Mam

1
CERTIFICATE
MAHARASHTRA STATE BOARD OF
TECHNICAL EDUCATION, MUMBAI

GOVERNMENT POLYTECHNIC, SOLAPUR

Title of microproject - Heart Disease prediction using Machine Learning in Python

This is to certify that the following students

Roll Enrolment Name


number number
04 2100150010 Sneha Umbrajkar
31 2100150080 Sayali Kshrisagar

of Branch Computer of semester Sixth (6) of diploma in Computer


Technology of institute Government Polytechnic, Solapur. Code (0015)
have completed the microproject work satisfactorily under my
supervision /guidance for the subject Programming With Python (22616)
in the academic year 2023-2024 as prescribed in the curriculum.
Guide Name –Prof.Kurapati Mam

Date & Sign –

HOD PRINCIPAL

2
ACKNOWLEDGEMENT

Presentation, inspiration and motivation have always played a key


role in the success of any venture. It is great pleasure for me to
undertake this project. I feel highly doing the project entitled –
“Heart Disease Prediction using ML in python ”. In the
present world of competition there is a race of existence in which
those are having will to come forward succeed. Project is like a
viaduct between theoretical and practical working. With this willing I
chose this particular project.
The success and outcome of this project were possible by the
guidance and support from many people. I’m incredibly privileged to
have got this all along with the achievement of my project. It required
a lot of effort from each individual involved in the project with me
and I would like to thank them.
I pay my deep sense of gratitude to Prof. Kurapati mam to
encourage me to the highest peak and to provide me the opportunity
to prepare this project. I am immensely obliged to my friends for their
elevating inspiration, encouraging guidance and kind supervision in
the completion of my project.

THANK YOU ◆v

3
INDEX

Sr. no. Title Page no.

1 Abstract 6

2 Introduction 7

3 Program Source Code 8

4 Microproject Output 11

5 Future Scope 13
6 Conclusion 14

7 References 15

4
ABSTRACT
In this study, we propose a heart disease prediction system using machine
learning algorithms implemented in Python. We utilize a dataset containing
various patient attributes such as age, sex, blood pressure, cholesterol levels,
and other clinical factors. The dataset is preprocessed to handle missing values,
normalize features, and remove outliers to ensure accurate model training.

We explore several machine learning algorithms including logistic regression,


decision trees, random forests, support vector machines, and neural networks
to build predictive models. The dataset is split into training and testing sets for
model evaluation and validation. We employ cross-validation techniques to
tune hyperparameters and optimize model performance.

The predictive models are assessed based on evaluation metrics such as


accuracy, precision, recall, F1-score, and area under the receiver operating
characteristic curve (AUC-ROC). The performance of each model is compared
to identify the most effective algorithm for heart disease prediction.

Our experimental results demonstrate the efficacy of machine learning in


accurately predicting heart disease risk based on patient attributes. The
proposed system provides a valuable tool for healthcare professionals to assess
patient risk factors and initiate preventive interventions, ultimately leading to
improved patient care and outcomes.

5
INTRODUCTION
Heart disease is a leading cause of mortality worldwide, accounting for a
significant portion of global deaths each year. Early detection and prediction of
heart disease play a crucial role in mitigating its impact and improving patient
outcomes. Machine learning techniques have emerged as promising tools for
predictive analytics in healthcare, offering the potential to analyze vast
amounts of medical data and extract valuable insights.

In this project, we aim to develop a heart disease prediction system using


machine learning algorithms implemented in Python. The system utilizes a
comprehensive dataset comprising various patient attributes such as age, sex,
blood pressure, cholesterol levels, and other clinical parameters. By leveraging
advanced machine learning models, we seek to accurately predict the
likelihood of heart disease based on these factors.

The project encompasses data preprocessing techniques to handle missing


values, normalize features, and address data imbalances. We explore a range of
machine learning algorithms, including logistic regression, decision trees,
random forests, support vector machines, and neural networks, to develop
predictive models. The dataset is divided into training and testing sets for
model evaluation and validation, with cross-validation techniques employed to
optimize model performance.

The ultimate goal of this project is to develop a reliable and efficient heart
disease prediction system that can assist healthcare professionals in assessing
patient risk factors and implementing preventive measures. By harnessing the
power of machine learning, we aim to contribute to the early detection and
management of heart disease, thereby enhancing patient care and reducing
mortality rates.

6
PROJECT SOURCE CODE

Code :

import pickle
import streamlit as st
from streamlit_option_menu import option_menu

#chatbot libraries
import nltk
import nltk.chat.util
from nltk.chat import util
from chat_patterns import patterns

with st.sidebar:

selected = option_menu('Heart Disease prediction System',

['Predicting from your Symptoms',


'Chat for your Heart',
'About Us'],

icons=['heart-pulse-fill','chat-left-heart','info-circle-fill'],
default_index = 0,
menu_icon=['clipboard2-pulse-fill'],
)

if (selected == 'Chat for your Heart'):


st.title('Welcome to our chatbot!')
st.title('Feel free to ask anything...')

#patterns=[(r'what is heart disease/?',['Heart disease, also known as cardiovascular


disease, refers to a class of diseases that involve the heart or blood vessels. It is a broad
term that encompasses various conditions, and the most common type is coronary artery
disease.']),(r'what are the symptoms of heart disease/?',['nausea or vomiting,chest
pain,muscle discomfort,dullness'])]
chatbot = util.Chat(patterns, util.reflections)

7
user_question = st.text_input('Ask a question:', key='user_input')
button_clicked = st.button('Get Answer')

responses = st.session_state.get('responses', [])

def process_input(user_input):
if user_input.lower() == 'quit':
return 'Thank you for using our chatbot!'
elif user_input.strip() == '':
return 'Please enter a valid question.'
else:
return chatbot.respond(user_input)

if button_clicked:
response = process_input(user_question)

# Append the new response to the list


responses.append({'question': user_question, 'response': response})

# Save the list in session state


st.session_state.responses = responses

# Display all responses


for entry in responses:
st.write(entry['question'])
st.write(entry['respons’])

8
9
10
MICRO-PROJECT OUTPUT

11
= FUTURE
SCOPE
The heart disease prediction system developed in this project lays the
groundwork for several avenues of future exploration and enhancement in the
realm of healthcare and machine learning. Some potential areas for further
development and research include:

Integration with Electronic Health Records (EHR): Integrating the


prediction system with electronic health record systems can facilitate real-time
risk assessment during patient consultations. By automatically analyzing
patient data from EHR systems, healthcare providers can receive timely alerts
and recommendations for preventive interventions.

Continuous Model Improvement: Continuous refinement and optimization of


machine learning models are essential to enhance prediction accuracy and
generalizability

Personalized Medicine: Tailoring predictive models to individual patient


characteristics and medical histories can enable personalized risk assessment
and treatment planning. By incorporating genetic data, lifestyle factors, and
patient preferences into the prediction system, healthcare providers can deliver
more targeted and effective interventions.

Longitudinal Data Analysis: Analyzing longitudinal patient data over time


can provide insights into disease progression and treatment efficacy. Future
iterations of the prediction system can incorporate longitudinal data analysis
techniques to track changes in patient risk profiles and adjust treatment
strategies accordingly.

Clinical Decision Support Systems: Integrating the prediction system into


clinical decision support systems (CDSS) can enhance healthcare provider
decision-making processes.

12
CONCLUSION
In conclusion, the development of a heart disease prediction system using
machine learning techniques in Python holds significant promise for improving
healthcare outcomes and reducing the burden of cardiovascular diseases.
Through the utilization of comprehensive patient data and advanced predictive
models, this project has demonstrated the potential to accurately assess the risk
of heart disease in individuals.

By leveraging machine learning algorithms such as logistic regression,


decision trees, random forests, support vector machines, and neural networks,
we have successfully constructed predictive models capable of analyzing
diverse patient attributes and making accurate predictions. These models offer
healthcare professionals valuable insights into patient risk factors, enabling
early intervention and personalized treatment strategies.

Furthermore, the implementation of data preprocessing techniques and cross-


validation methods ensures the robustness and reliability of the developed
prediction system. By addressing challenges such as missing data, feature
normalization, and model optimization, we have enhanced the accuracy and
generalizability of the predictive models.

13
REFERENCES

1. https://www.researchgate.net/publication/
351686488_Doctor_Chatbot_Heart_Disease_Prediction_System

2. https://link.springer.com/chapter/10.1007/978-981-19-3571-8_24

3. https://www.researchgate.net/publication/364087429_Text-
Based_Prediction_of_Heart_Disease_Doctor_Chatbot_Using_Machine_
Learning

4. https://ieeexplore.ieee.org/iel7/9951706/9951861/09951910.pdf

14

You might also like