├── images ├── sample.md ├── Data.png ├── Data info.png ├── Heatmap.png ├── Age boxplot.png ├── Gender plot.png ├── Target count.png ├── scatterplots.png ├── thalach vs age.png ├── Data description.png ├── Screenshot (12).png ├── Screenshot (13).png ├── Screenshot (14).png ├── Screenshot (15).png ├── Screenshot (16).png ├── Screenshot (17).png ├── Screenshot (18).png ├── Screenshot (19).png ├── Screenshot (20).png ├── Screenshot (21).png ├── Screenshot (22).png ├── Thalach boxplot.png ├── Cholestrol boxplot.png ├── Normalized metrics.png ├── Model Outcomes Metrics.png └── Chol Vs. Age Scatterplots.png ├── Image1.jpg ├── images.jpg ├── Data └── heart.csv └── README.md /images/sample.md: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /Image1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/suhasmaddali/Heart-Disease-Prediction/HEAD/Image1.jpg -------------------------------------------------------------------------------- /images.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/suhasmaddali/Heart-Disease-Prediction/HEAD/images.jpg -------------------------------------------------------------------------------- /images/Data.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/suhasmaddali/Heart-Disease-Prediction/HEAD/images/Data.png -------------------------------------------------------------------------------- /images/Data info.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/suhasmaddali/Heart-Disease-Prediction/HEAD/images/Data info.png -------------------------------------------------------------------------------- /images/Heatmap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/suhasmaddali/Heart-Disease-Prediction/HEAD/images/Heatmap.png -------------------------------------------------------------------------------- /images/Age boxplot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/suhasmaddali/Heart-Disease-Prediction/HEAD/images/Age boxplot.png -------------------------------------------------------------------------------- /images/Gender plot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/suhasmaddali/Heart-Disease-Prediction/HEAD/images/Gender plot.png -------------------------------------------------------------------------------- /images/Target count.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/suhasmaddali/Heart-Disease-Prediction/HEAD/images/Target count.png -------------------------------------------------------------------------------- /images/scatterplots.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/suhasmaddali/Heart-Disease-Prediction/HEAD/images/scatterplots.png -------------------------------------------------------------------------------- /images/thalach vs age.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/suhasmaddali/Heart-Disease-Prediction/HEAD/images/thalach vs age.png -------------------------------------------------------------------------------- /images/Data description.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/suhasmaddali/Heart-Disease-Prediction/HEAD/images/Data description.png -------------------------------------------------------------------------------- /images/Screenshot (12).png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/suhasmaddali/Heart-Disease-Prediction/HEAD/images/Screenshot (12).png -------------------------------------------------------------------------------- /images/Screenshot (13).png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/suhasmaddali/Heart-Disease-Prediction/HEAD/images/Screenshot (13).png -------------------------------------------------------------------------------- /images/Screenshot (14).png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/suhasmaddali/Heart-Disease-Prediction/HEAD/images/Screenshot (14).png -------------------------------------------------------------------------------- /images/Screenshot (15).png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/suhasmaddali/Heart-Disease-Prediction/HEAD/images/Screenshot (15).png -------------------------------------------------------------------------------- /images/Screenshot (16).png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/suhasmaddali/Heart-Disease-Prediction/HEAD/images/Screenshot (16).png -------------------------------------------------------------------------------- /images/Screenshot (17).png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/suhasmaddali/Heart-Disease-Prediction/HEAD/images/Screenshot (17).png -------------------------------------------------------------------------------- /images/Screenshot (18).png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/suhasmaddali/Heart-Disease-Prediction/HEAD/images/Screenshot (18).png -------------------------------------------------------------------------------- /images/Screenshot (19).png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/suhasmaddali/Heart-Disease-Prediction/HEAD/images/Screenshot (19).png -------------------------------------------------------------------------------- /images/Screenshot (20).png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/suhasmaddali/Heart-Disease-Prediction/HEAD/images/Screenshot (20).png -------------------------------------------------------------------------------- /images/Screenshot (21).png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/suhasmaddali/Heart-Disease-Prediction/HEAD/images/Screenshot (21).png -------------------------------------------------------------------------------- /images/Screenshot (22).png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/suhasmaddali/Heart-Disease-Prediction/HEAD/images/Screenshot (22).png -------------------------------------------------------------------------------- /images/Thalach boxplot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/suhasmaddali/Heart-Disease-Prediction/HEAD/images/Thalach boxplot.png -------------------------------------------------------------------------------- /images/Cholestrol boxplot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/suhasmaddali/Heart-Disease-Prediction/HEAD/images/Cholestrol boxplot.png -------------------------------------------------------------------------------- /images/Normalized metrics.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/suhasmaddali/Heart-Disease-Prediction/HEAD/images/Normalized metrics.png -------------------------------------------------------------------------------- /images/Model Outcomes Metrics.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/suhasmaddali/Heart-Disease-Prediction/HEAD/images/Model Outcomes Metrics.png -------------------------------------------------------------------------------- /images/Chol Vs. Age Scatterplots.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/suhasmaddali/Heart-Disease-Prediction/HEAD/images/Chol Vs. Age Scatterplots.png -------------------------------------------------------------------------------- /Data/heart.csv: -------------------------------------------------------------------------------- 1 | age,sex,cp,trestbps,chol,fbs,restecg,thalach,exang,oldpeak,slope,ca,thal,target 2 | 63,1,3,145,233,1,0,150,0,2.3,0,0,1,1 3 | 37,1,2,130,250,0,1,187,0,3.5,0,0,2,1 4 | 41,0,1,130,204,0,0,172,0,1.4,2,0,2,1 5 | 56,1,1,120,236,0,1,178,0,0.8,2,0,2,1 6 | 57,0,0,120,354,0,1,163,1,0.6,2,0,2,1 7 | 57,1,0,140,192,0,1,148,0,0.4,1,0,1,1 8 | 56,0,1,140,294,0,0,153,0,1.3,1,0,2,1 9 | 44,1,1,120,263,0,1,173,0,0,2,0,3,1 10 | 52,1,2,172,199,1,1,162,0,0.5,2,0,3,1 11 | 57,1,2,150,168,0,1,174,0,1.6,2,0,2,1 12 | 54,1,0,140,239,0,1,160,0,1.2,2,0,2,1 13 | 48,0,2,130,275,0,1,139,0,0.2,2,0,2,1 14 | 49,1,1,130,266,0,1,171,0,0.6,2,0,2,1 15 | 64,1,3,110,211,0,0,144,1,1.8,1,0,2,1 16 | 58,0,3,150,283,1,0,162,0,1,2,0,2,1 17 | 50,0,2,120,219,0,1,158,0,1.6,1,0,2,1 18 | 58,0,2,120,340,0,1,172,0,0,2,0,2,1 19 | 66,0,3,150,226,0,1,114,0,2.6,0,0,2,1 20 | 43,1,0,150,247,0,1,171,0,1.5,2,0,2,1 21 | 69,0,3,140,239,0,1,151,0,1.8,2,2,2,1 22 | 59,1,0,135,234,0,1,161,0,0.5,1,0,3,1 23 | 44,1,2,130,233,0,1,179,1,0.4,2,0,2,1 24 | 42,1,0,140,226,0,1,178,0,0,2,0,2,1 25 | 61,1,2,150,243,1,1,137,1,1,1,0,2,1 26 | 40,1,3,140,199,0,1,178,1,1.4,2,0,3,1 27 | 71,0,1,160,302,0,1,162,0,0.4,2,2,2,1 28 | 59,1,2,150,212,1,1,157,0,1.6,2,0,2,1 29 | 51,1,2,110,175,0,1,123,0,0.6,2,0,2,1 30 | 65,0,2,140,417,1,0,157,0,0.8,2,1,2,1 31 | 53,1,2,130,197,1,0,152,0,1.2,0,0,2,1 32 | 41,0,1,105,198,0,1,168,0,0,2,1,2,1 33 | 65,1,0,120,177,0,1,140,0,0.4,2,0,3,1 34 | 44,1,1,130,219,0,0,188,0,0,2,0,2,1 35 | 54,1,2,125,273,0,0,152,0,0.5,0,1,2,1 36 | 51,1,3,125,213,0,0,125,1,1.4,2,1,2,1 37 | 46,0,2,142,177,0,0,160,1,1.4,0,0,2,1 38 | 54,0,2,135,304,1,1,170,0,0,2,0,2,1 39 | 54,1,2,150,232,0,0,165,0,1.6,2,0,3,1 40 | 65,0,2,155,269,0,1,148,0,0.8,2,0,2,1 41 | 65,0,2,160,360,0,0,151,0,0.8,2,0,2,1 42 | 51,0,2,140,308,0,0,142,0,1.5,2,1,2,1 43 | 48,1,1,130,245,0,0,180,0,0.2,1,0,2,1 44 | 45,1,0,104,208,0,0,148,1,3,1,0,2,1 45 | 53,0,0,130,264,0,0,143,0,0.4,1,0,2,1 46 | 39,1,2,140,321,0,0,182,0,0,2,0,2,1 47 | 52,1,1,120,325,0,1,172,0,0.2,2,0,2,1 48 | 44,1,2,140,235,0,0,180,0,0,2,0,2,1 49 | 47,1,2,138,257,0,0,156,0,0,2,0,2,1 50 | 53,0,2,128,216,0,0,115,0,0,2,0,0,1 51 | 53,0,0,138,234,0,0,160,0,0,2,0,2,1 52 | 51,0,2,130,256,0,0,149,0,0.5,2,0,2,1 53 | 66,1,0,120,302,0,0,151,0,0.4,1,0,2,1 54 | 62,1,2,130,231,0,1,146,0,1.8,1,3,3,1 55 | 44,0,2,108,141,0,1,175,0,0.6,1,0,2,1 56 | 63,0,2,135,252,0,0,172,0,0,2,0,2,1 57 | 52,1,1,134,201,0,1,158,0,0.8,2,1,2,1 58 | 48,1,0,122,222,0,0,186,0,0,2,0,2,1 59 | 45,1,0,115,260,0,0,185,0,0,2,0,2,1 60 | 34,1,3,118,182,0,0,174,0,0,2,0,2,1 61 | 57,0,0,128,303,0,0,159,0,0,2,1,2,1 62 | 71,0,2,110,265,1,0,130,0,0,2,1,2,1 63 | 54,1,1,108,309,0,1,156,0,0,2,0,3,1 64 | 52,1,3,118,186,0,0,190,0,0,1,0,1,1 65 | 41,1,1,135,203,0,1,132,0,0,1,0,1,1 66 | 58,1,2,140,211,1,0,165,0,0,2,0,2,1 67 | 35,0,0,138,183,0,1,182,0,1.4,2,0,2,1 68 | 51,1,2,100,222,0,1,143,1,1.2,1,0,2,1 69 | 45,0,1,130,234,0,0,175,0,0.6,1,0,2,1 70 | 44,1,1,120,220,0,1,170,0,0,2,0,2,1 71 | 62,0,0,124,209,0,1,163,0,0,2,0,2,1 72 | 54,1,2,120,258,0,0,147,0,0.4,1,0,3,1 73 | 51,1,2,94,227,0,1,154,1,0,2,1,3,1 74 | 29,1,1,130,204,0,0,202,0,0,2,0,2,1 75 | 51,1,0,140,261,0,0,186,1,0,2,0,2,1 76 | 43,0,2,122,213,0,1,165,0,0.2,1,0,2,1 77 | 55,0,1,135,250,0,0,161,0,1.4,1,0,2,1 78 | 51,1,2,125,245,1,0,166,0,2.4,1,0,2,1 79 | 59,1,1,140,221,0,1,164,1,0,2,0,2,1 80 | 52,1,1,128,205,1,1,184,0,0,2,0,2,1 81 | 58,1,2,105,240,0,0,154,1,0.6,1,0,3,1 82 | 41,1,2,112,250,0,1,179,0,0,2,0,2,1 83 | 45,1,1,128,308,0,0,170,0,0,2,0,2,1 84 | 60,0,2,102,318,0,1,160,0,0,2,1,2,1 85 | 52,1,3,152,298,1,1,178,0,1.2,1,0,3,1 86 | 42,0,0,102,265,0,0,122,0,0.6,1,0,2,1 87 | 67,0,2,115,564,0,0,160,0,1.6,1,0,3,1 88 | 68,1,2,118,277,0,1,151,0,1,2,1,3,1 89 | 46,1,1,101,197,1,1,156,0,0,2,0,3,1 90 | 54,0,2,110,214,0,1,158,0,1.6,1,0,2,1 91 | 58,0,0,100,248,0,0,122,0,1,1,0,2,1 92 | 48,1,2,124,255,1,1,175,0,0,2,2,2,1 93 | 57,1,0,132,207,0,1,168,1,0,2,0,3,1 94 | 52,1,2,138,223,0,1,169,0,0,2,4,2,1 95 | 54,0,1,132,288,1,0,159,1,0,2,1,2,1 96 | 45,0,1,112,160,0,1,138,0,0,1,0,2,1 97 | 53,1,0,142,226,0,0,111,1,0,2,0,3,1 98 | 62,0,0,140,394,0,0,157,0,1.2,1,0,2,1 99 | 52,1,0,108,233,1,1,147,0,0.1,2,3,3,1 100 | 43,1,2,130,315,0,1,162,0,1.9,2,1,2,1 101 | 53,1,2,130,246,1,0,173,0,0,2,3,2,1 102 | 42,1,3,148,244,0,0,178,0,0.8,2,2,2,1 103 | 59,1,3,178,270,0,0,145,0,4.2,0,0,3,1 104 | 63,0,1,140,195,0,1,179,0,0,2,2,2,1 105 | 42,1,2,120,240,1,1,194,0,0.8,0,0,3,1 106 | 50,1,2,129,196,0,1,163,0,0,2,0,2,1 107 | 68,0,2,120,211,0,0,115,0,1.5,1,0,2,1 108 | 69,1,3,160,234,1,0,131,0,0.1,1,1,2,1 109 | 45,0,0,138,236,0,0,152,1,0.2,1,0,2,1 110 | 50,0,1,120,244,0,1,162,0,1.1,2,0,2,1 111 | 50,0,0,110,254,0,0,159,0,0,2,0,2,1 112 | 64,0,0,180,325,0,1,154,1,0,2,0,2,1 113 | 57,1,2,150,126,1,1,173,0,0.2,2,1,3,1 114 | 64,0,2,140,313,0,1,133,0,0.2,2,0,3,1 115 | 43,1,0,110,211,0,1,161,0,0,2,0,3,1 116 | 55,1,1,130,262,0,1,155,0,0,2,0,2,1 117 | 37,0,2,120,215,0,1,170,0,0,2,0,2,1 118 | 41,1,2,130,214,0,0,168,0,2,1,0,2,1 119 | 56,1,3,120,193,0,0,162,0,1.9,1,0,3,1 120 | 46,0,1,105,204,0,1,172,0,0,2,0,2,1 121 | 46,0,0,138,243,0,0,152,1,0,1,0,2,1 122 | 64,0,0,130,303,0,1,122,0,2,1,2,2,1 123 | 59,1,0,138,271,0,0,182,0,0,2,0,2,1 124 | 41,0,2,112,268,0,0,172,1,0,2,0,2,1 125 | 54,0,2,108,267,0,0,167,0,0,2,0,2,1 126 | 39,0,2,94,199,0,1,179,0,0,2,0,2,1 127 | 34,0,1,118,210,0,1,192,0,0.7,2,0,2,1 128 | 47,1,0,112,204,0,1,143,0,0.1,2,0,2,1 129 | 67,0,2,152,277,0,1,172,0,0,2,1,2,1 130 | 52,0,2,136,196,0,0,169,0,0.1,1,0,2,1 131 | 74,0,1,120,269,0,0,121,1,0.2,2,1,2,1 132 | 54,0,2,160,201,0,1,163,0,0,2,1,2,1 133 | 49,0,1,134,271,0,1,162,0,0,1,0,2,1 134 | 42,1,1,120,295,0,1,162,0,0,2,0,2,1 135 | 41,1,1,110,235,0,1,153,0,0,2,0,2,1 136 | 41,0,1,126,306,0,1,163,0,0,2,0,2,1 137 | 49,0,0,130,269,0,1,163,0,0,2,0,2,1 138 | 60,0,2,120,178,1,1,96,0,0,2,0,2,1 139 | 62,1,1,128,208,1,0,140,0,0,2,0,2,1 140 | 57,1,0,110,201,0,1,126,1,1.5,1,0,1,1 141 | 64,1,0,128,263,0,1,105,1,0.2,1,1,3,1 142 | 51,0,2,120,295,0,0,157,0,0.6,2,0,2,1 143 | 43,1,0,115,303,0,1,181,0,1.2,1,0,2,1 144 | 42,0,2,120,209,0,1,173,0,0,1,0,2,1 145 | 67,0,0,106,223,0,1,142,0,0.3,2,2,2,1 146 | 76,0,2,140,197,0,2,116,0,1.1,1,0,2,1 147 | 70,1,1,156,245,0,0,143,0,0,2,0,2,1 148 | 44,0,2,118,242,0,1,149,0,0.3,1,1,2,1 149 | 60,0,3,150,240,0,1,171,0,0.9,2,0,2,1 150 | 44,1,2,120,226,0,1,169,0,0,2,0,2,1 151 | 42,1,2,130,180,0,1,150,0,0,2,0,2,1 152 | 66,1,0,160,228,0,0,138,0,2.3,2,0,1,1 153 | 71,0,0,112,149,0,1,125,0,1.6,1,0,2,1 154 | 64,1,3,170,227,0,0,155,0,0.6,1,0,3,1 155 | 66,0,2,146,278,0,0,152,0,0,1,1,2,1 156 | 39,0,2,138,220,0,1,152,0,0,1,0,2,1 157 | 58,0,0,130,197,0,1,131,0,0.6,1,0,2,1 158 | 47,1,2,130,253,0,1,179,0,0,2,0,2,1 159 | 35,1,1,122,192,0,1,174,0,0,2,0,2,1 160 | 58,1,1,125,220,0,1,144,0,0.4,1,4,3,1 161 | 56,1,1,130,221,0,0,163,0,0,2,0,3,1 162 | 56,1,1,120,240,0,1,169,0,0,0,0,2,1 163 | 55,0,1,132,342,0,1,166,0,1.2,2,0,2,1 164 | 41,1,1,120,157,0,1,182,0,0,2,0,2,1 165 | 38,1,2,138,175,0,1,173,0,0,2,4,2,1 166 | 38,1,2,138,175,0,1,173,0,0,2,4,2,1 167 | 67,1,0,160,286,0,0,108,1,1.5,1,3,2,0 168 | 67,1,0,120,229,0,0,129,1,2.6,1,2,3,0 169 | 62,0,0,140,268,0,0,160,0,3.6,0,2,2,0 170 | 63,1,0,130,254,0,0,147,0,1.4,1,1,3,0 171 | 53,1,0,140,203,1,0,155,1,3.1,0,0,3,0 172 | 56,1,2,130,256,1,0,142,1,0.6,1,1,1,0 173 | 48,1,1,110,229,0,1,168,0,1,0,0,3,0 174 | 58,1,1,120,284,0,0,160,0,1.8,1,0,2,0 175 | 58,1,2,132,224,0,0,173,0,3.2,2,2,3,0 176 | 60,1,0,130,206,0,0,132,1,2.4,1,2,3,0 177 | 40,1,0,110,167,0,0,114,1,2,1,0,3,0 178 | 60,1,0,117,230,1,1,160,1,1.4,2,2,3,0 179 | 64,1,2,140,335,0,1,158,0,0,2,0,2,0 180 | 43,1,0,120,177,0,0,120,1,2.5,1,0,3,0 181 | 57,1,0,150,276,0,0,112,1,0.6,1,1,1,0 182 | 55,1,0,132,353,0,1,132,1,1.2,1,1,3,0 183 | 65,0,0,150,225,0,0,114,0,1,1,3,3,0 184 | 61,0,0,130,330,0,0,169,0,0,2,0,2,0 185 | 58,1,2,112,230,0,0,165,0,2.5,1,1,3,0 186 | 50,1,0,150,243,0,0,128,0,2.6,1,0,3,0 187 | 44,1,0,112,290,0,0,153,0,0,2,1,2,0 188 | 60,1,0,130,253,0,1,144,1,1.4,2,1,3,0 189 | 54,1,0,124,266,0,0,109,1,2.2,1,1,3,0 190 | 50,1,2,140,233,0,1,163,0,0.6,1,1,3,0 191 | 41,1,0,110,172,0,0,158,0,0,2,0,3,0 192 | 51,0,0,130,305,0,1,142,1,1.2,1,0,3,0 193 | 58,1,0,128,216,0,0,131,1,2.2,1,3,3,0 194 | 54,1,0,120,188,0,1,113,0,1.4,1,1,3,0 195 | 60,1,0,145,282,0,0,142,1,2.8,1,2,3,0 196 | 60,1,2,140,185,0,0,155,0,3,1,0,2,0 197 | 59,1,0,170,326,0,0,140,1,3.4,0,0,3,0 198 | 46,1,2,150,231,0,1,147,0,3.6,1,0,2,0 199 | 67,1,0,125,254,1,1,163,0,0.2,1,2,3,0 200 | 62,1,0,120,267,0,1,99,1,1.8,1,2,3,0 201 | 65,1,0,110,248,0,0,158,0,0.6,2,2,1,0 202 | 44,1,0,110,197,0,0,177,0,0,2,1,2,0 203 | 60,1,0,125,258,0,0,141,1,2.8,1,1,3,0 204 | 58,1,0,150,270,0,0,111,1,0.8,2,0,3,0 205 | 68,1,2,180,274,1,0,150,1,1.6,1,0,3,0 206 | 62,0,0,160,164,0,0,145,0,6.2,0,3,3,0 207 | 52,1,0,128,255,0,1,161,1,0,2,1,3,0 208 | 59,1,0,110,239,0,0,142,1,1.2,1,1,3,0 209 | 60,0,0,150,258,0,0,157,0,2.6,1,2,3,0 210 | 49,1,2,120,188,0,1,139,0,2,1,3,3,0 211 | 59,1,0,140,177,0,1,162,1,0,2,1,3,0 212 | 57,1,2,128,229,0,0,150,0,0.4,1,1,3,0 213 | 61,1,0,120,260,0,1,140,1,3.6,1,1,3,0 214 | 39,1,0,118,219,0,1,140,0,1.2,1,0,3,0 215 | 61,0,0,145,307,0,0,146,1,1,1,0,3,0 216 | 56,1,0,125,249,1,0,144,1,1.2,1,1,2,0 217 | 43,0,0,132,341,1,0,136,1,3,1,0,3,0 218 | 62,0,2,130,263,0,1,97,0,1.2,1,1,3,0 219 | 63,1,0,130,330,1,0,132,1,1.8,2,3,3,0 220 | 65,1,0,135,254,0,0,127,0,2.8,1,1,3,0 221 | 48,1,0,130,256,1,0,150,1,0,2,2,3,0 222 | 63,0,0,150,407,0,0,154,0,4,1,3,3,0 223 | 55,1,0,140,217,0,1,111,1,5.6,0,0,3,0 224 | 65,1,3,138,282,1,0,174,0,1.4,1,1,2,0 225 | 56,0,0,200,288,1,0,133,1,4,0,2,3,0 226 | 54,1,0,110,239,0,1,126,1,2.8,1,1,3,0 227 | 70,1,0,145,174,0,1,125,1,2.6,0,0,3,0 228 | 62,1,1,120,281,0,0,103,0,1.4,1,1,3,0 229 | 35,1,0,120,198,0,1,130,1,1.6,1,0,3,0 230 | 59,1,3,170,288,0,0,159,0,0.2,1,0,3,0 231 | 64,1,2,125,309,0,1,131,1,1.8,1,0,3,0 232 | 47,1,2,108,243,0,1,152,0,0,2,0,2,0 233 | 57,1,0,165,289,1,0,124,0,1,1,3,3,0 234 | 55,1,0,160,289,0,0,145,1,0.8,1,1,3,0 235 | 64,1,0,120,246,0,0,96,1,2.2,0,1,2,0 236 | 70,1,0,130,322,0,0,109,0,2.4,1,3,2,0 237 | 51,1,0,140,299,0,1,173,1,1.6,2,0,3,0 238 | 58,1,0,125,300,0,0,171,0,0,2,2,3,0 239 | 60,1,0,140,293,0,0,170,0,1.2,1,2,3,0 240 | 77,1,0,125,304,0,0,162,1,0,2,3,2,0 241 | 35,1,0,126,282,0,0,156,1,0,2,0,3,0 242 | 70,1,2,160,269,0,1,112,1,2.9,1,1,3,0 243 | 59,0,0,174,249,0,1,143,1,0,1,0,2,0 244 | 64,1,0,145,212,0,0,132,0,2,1,2,1,0 245 | 57,1,0,152,274,0,1,88,1,1.2,1,1,3,0 246 | 56,1,0,132,184,0,0,105,1,2.1,1,1,1,0 247 | 48,1,0,124,274,0,0,166,0,0.5,1,0,3,0 248 | 56,0,0,134,409,0,0,150,1,1.9,1,2,3,0 249 | 66,1,1,160,246,0,1,120,1,0,1,3,1,0 250 | 54,1,1,192,283,0,0,195,0,0,2,1,3,0 251 | 69,1,2,140,254,0,0,146,0,2,1,3,3,0 252 | 51,1,0,140,298,0,1,122,1,4.2,1,3,3,0 253 | 43,1,0,132,247,1,0,143,1,0.1,1,4,3,0 254 | 62,0,0,138,294,1,1,106,0,1.9,1,3,2,0 255 | 67,1,0,100,299,0,0,125,1,0.9,1,2,2,0 256 | 59,1,3,160,273,0,0,125,0,0,2,0,2,0 257 | 45,1,0,142,309,0,0,147,1,0,1,3,3,0 258 | 58,1,0,128,259,0,0,130,1,3,1,2,3,0 259 | 50,1,0,144,200,0,0,126,1,0.9,1,0,3,0 260 | 62,0,0,150,244,0,1,154,1,1.4,1,0,2,0 261 | 38,1,3,120,231,0,1,182,1,3.8,1,0,3,0 262 | 66,0,0,178,228,1,1,165,1,1,1,2,3,0 263 | 52,1,0,112,230,0,1,160,0,0,2,1,2,0 264 | 53,1,0,123,282,0,1,95,1,2,1,2,3,0 265 | 63,0,0,108,269,0,1,169,1,1.8,1,2,2,0 266 | 54,1,0,110,206,0,0,108,1,0,1,1,2,0 267 | 66,1,0,112,212,0,0,132,1,0.1,2,1,2,0 268 | 55,0,0,180,327,0,2,117,1,3.4,1,0,2,0 269 | 49,1,2,118,149,0,0,126,0,0.8,2,3,2,0 270 | 54,1,0,122,286,0,0,116,1,3.2,1,2,2,0 271 | 56,1,0,130,283,1,0,103,1,1.6,0,0,3,0 272 | 46,1,0,120,249,0,0,144,0,0.8,2,0,3,0 273 | 61,1,3,134,234,0,1,145,0,2.6,1,2,2,0 274 | 67,1,0,120,237,0,1,71,0,1,1,0,2,0 275 | 58,1,0,100,234,0,1,156,0,0.1,2,1,3,0 276 | 47,1,0,110,275,0,0,118,1,1,1,1,2,0 277 | 52,1,0,125,212,0,1,168,0,1,2,2,3,0 278 | 58,1,0,146,218,0,1,105,0,2,1,1,3,0 279 | 57,1,1,124,261,0,1,141,0,0.3,2,0,3,0 280 | 58,0,1,136,319,1,0,152,0,0,2,2,2,0 281 | 61,1,0,138,166,0,0,125,1,3.6,1,1,2,0 282 | 42,1,0,136,315,0,1,125,1,1.8,1,0,1,0 283 | 52,1,0,128,204,1,1,156,1,1,1,0,0,0 284 | 59,1,2,126,218,1,1,134,0,2.2,1,1,1,0 285 | 40,1,0,152,223,0,1,181,0,0,2,0,3,0 286 | 61,1,0,140,207,0,0,138,1,1.9,2,1,3,0 287 | 46,1,0,140,311,0,1,120,1,1.8,1,2,3,0 288 | 59,1,3,134,204,0,1,162,0,0.8,2,2,2,0 289 | 57,1,1,154,232,0,0,164,0,0,2,1,2,0 290 | 57,1,0,110,335,0,1,143,1,3,1,1,3,0 291 | 55,0,0,128,205,0,2,130,1,2,1,1,3,0 292 | 61,1,0,148,203,0,1,161,0,0,2,1,3,0 293 | 58,1,0,114,318,0,2,140,0,4.4,0,3,1,0 294 | 58,0,0,170,225,1,0,146,1,2.8,1,2,1,0 295 | 67,1,2,152,212,0,0,150,0,0.8,1,0,3,0 296 | 44,1,0,120,169,0,1,144,1,2.8,0,0,1,0 297 | 63,1,0,140,187,0,0,144,1,4,2,2,3,0 298 | 63,0,0,124,197,0,1,136,1,0,1,0,2,0 299 | 59,1,0,164,176,1,0,90,0,1,1,2,1,0 300 | 57,0,0,140,241,0,1,123,1,0.2,1,0,3,0 301 | 45,1,3,110,264,0,1,132,0,1.2,1,0,3,0 302 | 68,1,0,144,193,1,1,141,0,3.4,1,2,3,0 303 | 57,1,0,130,131,0,1,115,1,1.2,1,1,3,0 304 | 57,0,1,130,236,0,0,174,0,0,1,1,2,0 305 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # 🫀 Heart Disease Prediction Using Machine Learning and Deep Learning 2 | 3 | [![](https://img.shields.io/badge/Python-FFD43B?style=for-the-badge&logo=python&logoColor=darkgreen)](https://www.python.org) [![](https://img.shields.io/badge/TensorFlow-FF6F00?style=for-the-badge&logo=TensorFlow&logoColor=white)](https://www.tensorflow.org) [![](https://img.shields.io/badge/scikit_learn-F7931E?style=for-the-badge&logo=scikit-learn&logoColor=white)](https://scikit-learn.org/stable/) [![](https://img.shields.io/badge/SciPy-654FF0?style=for-the-badge&logo=SciPy&logoColor=white)](https://www.scipy.org) [![](https://img.shields.io/badge/Numpy-777BB4?style=for-the-badge&logo=numpy&logoColor=white)](https://numpy.org) [![](https://img.shields.io/badge/Pandas-2C2D72?style=for-the-badge&logo=pandas&logoColor=white)](https://pandas.pydata.org) [![](https://img.shields.io/badge/Plotly-239120?style=for-the-badge&logo=plotly&logoColor=white)](https://plotly.com) [![](https://img.shields.io/badge/Keras-D00000?style=for-the-badge&logo=Keras&logoColor=white)](https://keras.io) [![](https://img.shields.io/badge/conda-342B029.svg?&style=for-the-badge&logo=anaconda&logoColor=white)](https://www.anaconda.com) 4 | 5 | ## Introduction 6 | 7 | Predicting the condition of a patient in the case of __heart disease__ is important. It would be good if a patient could get to know the condition before itself rather than visiting the doctor. Patients spend a __significant amount__ of time trying to get an appointment with doctors. After they get the appointment, they would have to give a lot of tests. 8 | 9 | 10 | 11 | It is also important that a doctor be present so that they could treat them. To make things worse, the tests usually take a long time before __diagnosing__ whether a person would suffer from heart disease. However, it would be handy and better if we automate this process which ensures that we save a lot of time and effort on the part of the doctor and patient. 12 | 13 | ## Machine Learning and Data Science 14 | 15 | With the aid of machine learning, it is possible to get to know the condition of a patient whether he/she would have heart disease or not based on a few features such as glucose levels and so on. Using machine learning algorithms, we are going to predict the chances of a person suffering from heart disease. In other words, we would be using various machine learning models for the prediction of the chances of heart disease in a patient. 16 | 17 | ## Data 18 | 19 | Some of the input features that would be considered in this example are __blood pressure__, __chest pain type__ and __cholestrol levels__. This is just a sample dataset with 303 rows. This is created just to understand different classification machine learning algorithms and sklearn implementation of them. Below is the link where you can find the source of the data. Thanks to __'kaggle'__ for providing this data. 20 | 21 | https://www.kaggle.com/johnsmith88/heart-disease-dataset 22 | 23 | ## Exploratory Data Analysis (EDA) 24 | 25 | When we are performing EDA, interesting insights could be drawn from the data and understood. Below are the key insights that were found as a result of working with the data. 26 | 27 | * The features __'thalach'__ and __'slope'__ are positively correlated. However, they are not highly correlated. 28 | * Features such as __'age'__ and __'thalach'__ which stands for __maximum heart rate achieved__ are negatively correlated as indicated by the correlation heatmap plot. 29 | * __'age'__ is negatively correlated with __'restecg'__ as shown in the heatmap plot. 30 | * The features __'cp'__ and __'exang'__ are negatively correlated. 31 | * The feature __'resting blood pressure'__ is somewhat positively correlated with __'age'__ as shown in the plots. 32 | * The feature __'trestbps'__ that stands for resting blood pressure is somewhat correlated with the feature __'fbs'__ that stands for fasting blood pressure. 33 | 34 | ## Visualizations 35 | 36 | In this section, we will be visualizing some interests plots and trends in the data which is used by machine learning models to make predictions. We will also evaluate the performance of different machine learning and deep learning models on a given dataset by comparing various metrics. To identify the best version of each model, we will examine their hyperparameters. 37 | 38 | To begin, we will review the list of rows and columns (features) in our dataset, which includes age, sex, cp (chest pain), chol, and others. This will provide insight into the types of features present and help us determine if additional features are necessary for analysis. 39 | 40 | 41 | 42 | Next, we will examine the list of non-null values in the data to identify any missing values. Since there are 303 entries, we know that the dataset includes 303 patients. Additionally, the memory usage is minimal, so downcasting is not necessary. 43 | 44 | 45 | 46 | The study's participants have an **average age** of approximately **55 years**. While most values in the dataset are **numerical**, some are **categorical**. To convert categorical features into numerical ones, we will use **one-hot encoding**. 47 | 48 | 49 | 50 | This plot demonstrates the total number of patients who had a **heart disease** vs. the number of patients who did not have a **heart disease**. This shows that a large number of patients had **heart disease**. Therefore, it becomes easy for us to build interesting **classifiers** as we have more information about patients with **heart disease**. In addition, the total classes are **balanced** which means that we can use metrics such as **accuracy** for understanding the ML model performance. 51 | 52 | 53 | 54 | The plot shows the **prevalence** of heart disease by **gender**. The data has more samples for males than females and suggests a gender difference in **survival rates**. The data is slightly imbalanced but not significantly. 55 | 56 | 57 | 58 | The heatmap shows the **correlations** between pairs of features. The lighter the color, the stronger the correlation according to the color map. For example, 'thalach' and 'slope' have a positive correlation, while 'slope' and 'oldpeak' have a negative correlation. Other features can be further explored for their correlations. 59 | 60 | 61 | 62 | The plot below shows a **negative** correlation between age and thalach. This suggests that thalach can be a predictor of age and vice versa. This relationship can be useful for model predictions. 63 | 64 | 65 | 66 | There are some interesting **trends and patterns** found in the dataset. It could be seen that **higher values of thalach** and **lower values of oldpeak** can have an impact about whether a person can suffer from heart disease. All in all, having a higher value of thalach is one of the factors that can be leading to heart disease according to the scatterplots displayed below. 67 | 68 | 69 | 70 | The plot shows a strong **positive** correlation between age and cholesterol levels. This reflects the common observation that older people tend to have higher cholesterol levels. This may vary across different countries and populations, but it is a general trend in the plot. 71 | 72 | 73 | 74 | The **cholesterol** feature in our dataset is univariate and primarily concentrated within the range of 200-300. However, there are a few **outliers**, such as values of 400 or 500. Although the sample size is not large, we cannot simply discard these values when inputting the feature into machine learning models for prediction purposes. 75 | 76 | 77 | 78 | According to the dataset, the **average** age of the patients is approximately 55 years, with the youngest being 30 and the oldest being 85 years old. The majority of individuals fall within the age range of 50-60 years. 79 | 80 | 81 | 82 | The plot displays the **performance** of various machine learning models based on different **evaluation metrics**, including accuracy, f1-score, precision, recall, and AUC scores. Naive Bayes stands out as a promising model for predicting heart disease, having achieved a high accuracy rate. Moreover, both KNN and Naive Bayes exhibit similar f1-scores and AUC scores, indicating comparable overall performance in terms of predicting heart disease. 83 | 84 | 85 | 86 | In machine learning, **normalization** and **standardization** are common preprocessing techniques used to ensure that data distribution does not affect model performance. If the initial data given to the model was standardized but not normalized, we can perform normalization and assess model performance on the test set. 87 | 88 | After normalization, the **Naive Bayes model** had the highest accuracy and F1-score compared to other models. This suggests that Naive Bayes is a good fit for the normalized data. 89 | 90 | 91 | 92 | ## Machine Learning Models 93 | 94 | There were many machine learning models used in the process of predicting the __heart diseases__. Below are the models that were used in the process of predicting heart diseases. 95 | 96 | * [__K Nearest Neighbors (KNN)__](https://scikit-learn.org/stable/modules/generated/sklearn.neighbors.KNeighborsClassifier.html) 97 | * [__Logistic Regression__](https://scikit-learn.org/stable/modules/generated/sklearn.linear_model.LogisticRegression.html) 98 | * [__Naive Bayes__](https://scikit-learn.org/stable/modules/generated/sklearn.naive_bayes.MultinomialNB.html) 99 | * [__Random Forest Classifier__](https://scikit-learn.org/stable/modules/generated/sklearn.ensemble.RandomForestClassifier.html) 100 | 101 | ## Outcomes 102 | 103 | * Based on the results generated, it could be seen that the __Naive Bayes model__ was performing the best in terms of the __F1 score__, __precision__, and __recall__ respectively. 104 | * __Naive Bayes model__ was also having the __highest accuracy__ in terms of classifying whether a person would have a __heart disease__ or not. 105 | 106 | ## Future Scope 107 | 108 | * __Additional data__ from many sources could be taken so that the models would be able to predict for __different conditions__ for the patients. 109 | * __More features__ that help determine whether a person would suffer from heart disease could be considered. 110 | * The **Naive Bayes model**, which had the best performance, could be deployed in real-time to provide doctors with faster inference results. This could aid in the diagnosis of whether a person is suffering from heart disease or not. 111 | * The quick and accurate results from the model could potentially help **doctors** make more timely and effective decisions in treating their patients. 112 | 113 | ## 👉 Directions to download the repository and run the notebook 114 | 115 | This is for the Washington Bike Demand Prediction repository. But the same steps could be followed for this repository. 116 | 117 | 1. You'll have to download and install Git which could be used for cloning the repositories that are present. The link to download Git is https://git-scm.com/downloads. 118 | 119 |    120 | 121 | 2. Once "Git" is downloaded and installed, you'll have to right-click on the location where you would like to download this repository. I would like to store it in the "Git Folder" location. 122 | 123 |    124 | 125 | 3. If you have successfully installed Git, you'll get an option called "Gitbash Here" when you right-click on a particular location. 126 | 127 |    128 | 129 | 130 | 4. Once the Gitbash terminal opens, you'll need to write "Git clone" and then paste the link to the repository. 131 | 132 |    133 | 134 | 5. The link to the repository can be found when you click on "Code" (Green button) and then, there would be an HTML link just below. Therefore, the command to download a particular repository should be "Git clone HTML" where the HTML is replaced by the link to this repository. 135 | 136 |    137 | 138 | 6. After successfully downloading the repository, there should be a folder with the name of the repository as can be seen below. 139 | 140 |    141 | 142 | 7. Once the repository is downloaded, go to the start button and search for "Anaconda Prompt" if you have anaconda installed. 143 | 144 |    145 | 146 | 8. Later, open the Jupyter notebook by writing "Jupyter notebook" in the Anaconda prompt. 147 | 148 |    149 | 150 | 9. Now the following would open with a list of directories. 151 | 152 |    153 | 154 | 10. Search for the location where you have downloaded the repository. Be sure to open that folder. 155 | 156 |    157 | 158 | 11. You might now run the .ipynb files present in the repository to open the notebook and the python code present in it. 159 | 160 |    161 | 162 | That's it, you should be able to read the code now. Thanks. 163 | 164 | --------------------------------------------------------------------------------