<jupyter_start><jupyter_text>**Heart-disease-prediction**Heart disease is a debilitating disease that affect many people around the world. Heart disease is an umbrella term that consists of other conditions that produce diseased vessels, structural problems and blood clots within heart structure. The symptoms of heart disease vary depending on the type of condition afflicting the patient. Each year heart disease is the leading cause of death in both men and women, affecting about 370,000 people.**This project is to just show some of the steps that could be taken analyzing a dataset using the heart disease dataset.**  **Steps:**- Importing Libraries- Uploading  dataset- Analyze dataset - Building model- Training model and validating model- Conclusion<jupyter_code># These are the libraray which will be used in solution you can use any other libraries 
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
from sklearn.model_selection import train_test_split
from sklearn.neighbors import KNeighborsClassifier
from sklearn.metrics import accuracy_score
from sklearn.metrics import classification_report
from keras.models import Sequential
from keras.layers import Dense
from pandas import set_option<jupyter_output><empty_output><jupyter_text>**Uploading dataset**The dataset that we will be using is a dataset from the UCI Machine Learning repository via a Kaggle competition. The data has been provided by the Cleveland Clinic Foundation. The dataset consists of patients ranging in age from 29 - 77 years old. There are a total of 303 instances and 14 attributes including our target variable of “presence” of heart disease. **Attributes**1.   sex:     sex (1 = male; 0 = female)2.   age:     age in years3.   cp :     chest pain type4.   trestb:  psresting blood pressure (in mm Hg on admission to the hospital)5.   chol:    serum cholestoral in mg/dl6.   fbs:     (fasting blood sugar > 120 mg/dl) (1 = true; 0 = false)7.   restecg: resting electrocardiographic results8.   thalach: maximum heart rate achieved9.   exang:   exercise induced angina (1 = yes; 0 = no)10.  oldpeak: ST depression induced by exercise relative to rest11.  slope:   The slope of the peak exercise ST segment12.  ca:      Number of major vessels (0-3) colored by flourosopy13.  thal:    3 = normal; 6 = fixed defect; 7 = reversable defect14.  target:  1 or 0 (0: No Disease, 1: Disease)<jupyter_code>data = #Upload data using pandas method
# Display the top 5 rows and column
# Write your one line code here
# Describe the data using describe method 
# Write your one line code here      
# Find if dataset has any missing value
# Write your code here<jupyter_output><empty_output><jupyter_text>Write wheather dataset has any missing values or not  **Analyze data**The dataset consists of patients ranging in age from 29 - 77 years old. There are a total of 303 instances and 14 attributes including our target variable.<jupyter_code>#Draw Bar graph of number of positive heart disease and negative in  target variable
#You can use seaborn
#Write your code here<jupyter_output><empty_output><jupyter_text>**Analyze dataset using histogram**<jupyter_code>#Analyze whole dataset using Histogram
#Write your code here<jupyter_output><empty_output><jupyter_text>**Analyze data using box plot**<jupyter_code>#Analyze whole dataset using box plot
#Write your code here<jupyter_output><empty_output><jupyter_text>**Analyze the Sex variable wrt target variable**<jupyter_code># Plot Bar graph with x axis represnting sex and y axis representing target
# Write your code here<jupyter_output><empty_output><jupyter_text>Write what you have concluded from above analysis **Analyze slope feature  wrt target**<jupyter_code># Describe unique values of slope variable
# Write your code here
# Plot Bar graph with x axis represnting slope and y axis representing target
# Write your code here<jupyter_output><empty_output><jupyter_text>Write what you have concluded from above analysis **Analysing the 'ca' feature wrt target**<jupyter_code># Describe unique values of ca variable
# Write your code here
# Plot Bar graph with x axis represnting ca and y axis representing target
# Write your code here<jupyter_output><empty_output><jupyter_text>Write what you have concluded from above analysis **Corelation Matrices**A much more common metric, and one directly calculable from the covariance, is the correlation.<jupyter_code>#Print correlation matrice using pandas or you can use any other library
# Write your code here<jupyter_output><empty_output><jupyter_text>**Building Model** **Train-test split**<jupyter_code># Split data in train and test with test size equal to 20 percent of total
# Write your code here using train_test_split method with test size equal to 20 percent of total
#Shape of train dataset
#Write your code here
#Shape of target train dataset
#Write your code here
#Shape of test dataset
#Wrie your code here
#Shape of test dataset
#Write your code here<jupyter_output><empty_output><jupyter_text>**K Nearest Neighbors**<jupyter_code>#Build KNN model using Inbuilt classifier scikit learn

#Write your code here<jupyter_output><empty_output><jupyter_text>**Neural Network**<jupyter_code># Build Neural network using keras with no of hidden layer equal to 7 and activation function as 'relu' and outer layer activation function as 'sigmoid'.

#Write your code here

# Write your code here to compile model with 'adam' optimizer
#Show the summary of the  Neural network  model
# Write your code here<jupyter_output><empty_output><jupyter_text>**Training and Validating Model** **K Nearest Neighbours**<jupyter_code># Print Accuracy Score
# Write your score here<jupyter_output><empty_output><jupyter_text>**Neural Network**1.   We have used 250 epochs to train2.   No of validating data = 20 percent of total *Note - You can change the value of epoch*<jupyter_code># Train your neural network with 250 epochs
# Write your code here
# Calculate the achieved accuracy 
# Write your code here
# Print the Accuracy achieved using Neural Network
#Write your code here<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.058564437194127246, 'fraction_numerical': 0.012561174551386623, 'mean_word_length': 5.373180873180873, 'pattern_counts': {'":': 0, '<': 57, '<?xml version=': 0, '>': 58, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '14', 'dir': 'jupyter-structured-clean-dedup', 'id': '378119', 'license': 'MIT', 'n_tokens_mistral': 1752, 'n_tokens_neox': 1658, 'n_words': 793, 'path': 'Heart-disease-prediction/Heart_disease_prediction_template.ipynb', 'repo_name': 'abhisngh/Data-Science', 'size': '6130'}