0% found this document useful (0 votes)
16 views10 pages

ML Report Edited

Uploaded by

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

ML Report Edited

Uploaded by

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

MINI PROJECT

HEART DISEASE PREDICTION

OVERVIEW:

The heart is the main component of the body's cardiovascular system,


which also includes the lungs, and is a type of muscular organ that
pumps blood into the body. The network of blood vessels in the
cardiovascular system includes capillaries, arteries, and veins. Blood
is distributed throughout the body by these blood vessels. Heart
diseases, also referred to as cardiovascular diseases (CVD), are caused
by abnormalities in the heart's normal blood flow. Globally, heart
diseases are the leading cause of death. The World Health
Organization (WHO) survey indicates that heart attacks and strokes
account for 17.5 million deaths worldwide. The majority of
cardiovascular disease deaths—more than 75% of them—occur in
middle-class and lower-class nations. Moreover, heart attacks and
strokes account for 80% of CVD-related deaths. Early detection of
cardiac abnormalities and the development of tools to predict heart
diseases can therefore save many lives and assist medical
professionals in creating treatment plans that are effective in lowering
the mortality rate from cardiovascular diseases.
Healthcare industries these days generate enormous amounts of data
about patients, disease diagnosis, and other related topics. Numerous
methods are available for extracting hidden patterns or similarities
from data through data mining.
The computer-based method of extracting meaningful information
from massive databases is known as data mining. Because data mining
can extract useful information from massive amounts of evidence, it is
especially useful in exploratory analyses. The clinical domain's data
sets contain cryptic patterns that can be explored through medical data
mining.

These patterns can be used to diagnose medical conditions.


Nonetheless, the raw medical data that are currently accessible are
widely dispersed, massive, and diverse in kind. A user-oriented
method for discovering new and hidden patterns in the data is provided
by data mining. In the healthcare industry, data mining techniques and
tools are helpful for forecasting different diseases and providing
answers to business queries. The prediction of diseases is an important
aspect of data mining. This paper uses classification algorithms to
analyze the heart disease predictions. Invisible patterns in medical data
can be used to diagnose illnesses.

An effective method for addressing the most recent and enduring


patterns in the data is provided by data mining technology. Healthcare
administrators can use the identified information to obtain better
services. The most common cause of death for victims in nations like
the US and India was heart disease. In this project, classification
algorithms are being used to predict the heart disease. Various machine
learning techniques, including classification algorithms Logistic
Regression, are employed to investigate heart-related problems.
MODULE SUMMARY:

1. Data Acquisition and Preprocessing:

- Data Collection: HDP gathers user commands, preferences, and


interaction history from various sources like microphones and text inputs.
- Preprocessing: Acquired data undergoes noise reduction, text
normalization, and feature extraction to enhance quality and relevance.

2. Deep Learning Model Architecture:

- Input Layer: Receives user input, such as text or audio, for further
processing.
- Feature Extraction Layers: Extracts relevant features using techniques
like CNNs or text embeddings.
- Training and Integration: The model is trained with labeled datasets and
integrated into HDP for real-time interaction and assistance.

3. Evaluation Metrics:

- Accuracy: Measures the percentage of correctly predicted user intents or


actions.
- Precision and Recall: Evaluate the proportion of relevant responses
among all generated responses and identified relevant responses from all actual
relevant responses.
- Latency: Measures the response time of HDP to user commands,
ensuring prompt assistance.

4. Future Scope:

- The main aim of this project was to design and implement Diabetes
Prediction Using Machine Learning Methods and Performance Analysis of that
methods and it has been achieved successfully.
- With larger datasets, more correlated variables and features, and an
algorithm that is more effective than before, and looking forward to developing this
model.
Process Flow Diagram:

Figure :1

Figure : 2
CODE :

import numpy as np
import pandas as pd
from sklearn.model_selection import train_test_split
from sklearn.linear_model import LogisticRegression
from sklearn.metrics import accuracy_score

heart_data = pd.read_csv('/content/data.csv')
heart_data.head()

heart_data.tail()
heart_data.shape

heart_data.info()
heart_data.isnull().sum()

# statistical measures about the data


heart_data.describe()

# checking the distribution of Target Variable


heart_data['target'].value_counts()

X = heart_data.drop(columns='target', axis=1)
Y = heart_data['target']

print(X)
print(Y)
X_train, X_test, Y_train, Y_test = train_test_split(X, Y, test_size=0.2,
stratify=Y, random_state=2)
print(X.shape, X_train.shape, X_test.shape)
model = LogisticRegression()

# training the LogisticRegression model with Training data


model.fit(X_train, Y_train)

# accuracy on training data


X_train_prediction = model.predict(X_train)
training_data_accuracy = accuracy_score(X_train_prediction, Y_train)
print('Accuracy on Training data : ', training_data_accuracy)
# accuracy on test data
X_test_prediction = model.predict(X_test)
test_data_accuracy = accuracy_score(X_test_prediction, Y_test)

print('Accuracy on Test data : ', test_data_accuracy)

input_data = (62,0,0,140,268,0,0,160,0,3.6,0,2,2)

# change the input data to a numpy array


input_data_as_numpy_array= np.asarray(input_data)

# reshape the numpy array as we are predicting for only on instance


input_data_reshaped = input_data_as_numpy_array.reshape(1,-1)

prediction = model.predict(input_data_reshaped)
print(prediction)

if (prediction[0]== 0):
print('The Person does not have a Heart Disease')
else:
print('The Person has Heart Disease')
OUTPUT :

Open Google
CONCLUSION :

The conclusion that was reached is that our understanding of this


subject is expanding. In this field, the accuracy of the model that
establishes overall reliability is one of the most crucial factors. Since
there is a risk to life, no shortcuts can be taken, so the model that is
used in this context needs to be extremely accurate. It's crucial to keep
in mind that the model mentioned above is based on a dataset that is
too small—just 1025 samples—to create a model that is extremely
accurate. We anticipate being able to identify additional characteristics
or factors that affect an individual's heart health in the near future.
In the field of AI, where we are also making progress, there exist
numerous more accurate and efficient models and algorithms than the
logistic regression model. And a tonne of new models and algorithms
are being created.

You might also like