Heart Disease Prediction using ANN
Deep Learning is a technology of which mimics a human brain in the sense that it consists of multiple neurons with multiple layers like a human brain. The network so formed consists of an input layer, an output layer, and one or more hidden layers. The network tries to learn from the data that is fed into it and then performs predictions accordingly. The most basic type of neural network is the ANN (Artificial Neural Network). The ANN does not have any special structure, it just comprises of multiple neural layers to be used for prediction.
Let’s build a model that predicts whether a person has heart disease or not by using ANN.
About the data:
In the dataset, we have 13 columns in which we are given different attributes such as sex, age, cholesterol level, etc. and we are given a target column which tells us whether that person has heart disease or not. We will keep all the columns as independent variables other than the target column because it will be our dependent variable. We will build an ANN which will predict whether a person has heart disease or not given other attributes of the person.
You can find the dataset here heart disease dataset
Code: Importing Dataset
Code: Check for null values
Assign Dependent and Independent variable
Code : Split data into Train and Test dataset
Code: Scale the data.
Code: Building the Model
Code : Fitting the Model
Code : Performing prediction and rescaling
Code: Confusion Matrix
We will get accuracy approximately around 85%.
Attention reader! Don’t stop learning now. Get hold of all the important Machine Learning Concepts with the Machine Learning Foundation Course at a student-friendly price and become industry ready.