├── Actual Data With Empty Values.csv ├── Description about Data.txt ├── HeartDiseasePredictor.py ├── MissingValueFinder.py ├── Output Graph Saved.png ├── Processed Data with No Empty Values.csv └── README.md /Actual Data With Empty Values.csv: -------------------------------------------------------------------------------- 1 | 63,1,1,145,233,1,2,150,0,2.3,3,0,6,0 2 | 67,1,4,160,286,0,2,108,1,1.5,2,3,3,2 3 | 67,1,4,120,229,0,2,129,1,2.6,2,2,7,1 4 | 37,1,3,130,250,0,0,187,0,3.5,3,0,3,0 5 | 41,0,2,130,204,0,2,172,0,1.4,1,0,3,0 6 | 56,1,2,120,236,0,0,178,0,0.8,1,0,3,0 7 | 62,0,4,140,268,0,2,160,0,3.6,3,2,3,3 8 | 57,0,4,120,354,0,0,163,1,0.6,1,0,3,0 9 | 63,1,4,130,254,0,2,147,0,1.4,2,1,7,2 10 | 53,1,4,140,203,1,2,155,1,3.1,3,0,7,1 11 | 57,1,4,140,192,0,0,148,0,0.4,2,0,6,0 12 | 56,0,2,140,294,0,2,153,0,1.3,2,0,3,0 13 | 56,1,3,130,256,1,2,142,1,0.6,2,1,6,2 14 | 44,1,2,120,263,0,0,173,0,0,1,0,7,0 15 | 52,1,3,172,199,1,0,162,0,0.5,1,0,7,0 16 | 57,1,3,150,168,0,0,174,0,1.6,1,0,3,0 17 | 48,1,2,110,229,0,0,168,0,1,3,0,7,1 18 | 54,1,4,140,239,0,0,160,0,1.2,1,0,3,0 19 | 48,0,3,130,275,0,0,139,0,0.2,1,0,3,0 20 | 49,1,2,130,266,0,0,171,0,0.6,1,0,3,0 21 | 64,1,1,110,211,0,2,144,1,1.8,2,0,3,0 22 | 58,0,1,150,283,1,2,162,0,1,1,0,3,0 23 | 58,1,2,120,284,0,2,160,0,1.8,2,0,3,1 24 | 58,1,3,132,224,0,2,173,0,3.2,1,2,7,3 25 | 60,1,4,130,206,0,2,132,1,2.4,2,2,7,4 26 | 50,0,3,120,219,0,0,158,0,1.6,2,0,3,0 27 | 58,0,3,120,340,0,0,172,0,0,1,0,3,0 28 | 66,0,1,150,226,0,0,114,0,2.6,3,0,3,0 29 | 43,1,4,150,247,0,0,171,0,1.5,1,0,3,0 30 | 40,1,4,110,167,0,2,114,1,2,2,0,7,3 31 | 69,0,1,140,239,0,0,151,0,1.8,1,2,3,0 32 | 60,1,4,117,230,1,0,160,1,1.4,1,2,7,2 33 | 64,1,3,140,335,0,0,158,0,0,1,0,3,1 34 | 59,1,4,135,234,0,0,161,0,0.5,2,0,7,0 35 | 44,1,3,130,233,0,0,179,1,0.4,1,0,3,0 36 | 42,1,4,140,226,0,0,178,0,0,1,0,3,0 37 | 43,1,4,120,177,0,2,120,1,2.5,2,0,7,3 38 | 57,1,4,150,276,0,2,112,1,0.6,2,1,6,1 39 | 55,1,4,132,353,0,0,132,1,1.2,2,1,7,3 40 | 61,1,3,150,243,1,0,137,1,1,2,0,3,0 41 | 65,0,4,150,225,0,2,114,0,1,2,3,7,4 42 | 40,1,1,140,199,0,0,178,1,1.4,1,0,7,0 43 | 71,0,2,160,302,0,0,162,0,0.4,1,2,3,0 44 | 59,1,3,150,212,1,0,157,0,1.6,1,0,3,0 45 | 61,0,4,130,330,0,2,169,0,0,1,0,3,1 46 | 58,1,3,112,230,0,2,165,0,2.5,2,1,7,4 47 | 51,1,3,110,175,0,0,123,0,0.6,1,0,3,0 48 | 50,1,4,150,243,0,2,128,0,2.6,2,0,7,4 49 | 65,0,3,140,417,1,2,157,0,0.8,1,1,3,0 50 | 53,1,3,130,197,1,2,152,0,1.2,3,0,3,0 51 | 41,0,2,105,198,0,0,168,0,0,1,1,3,0 52 | 65,1,4,120,177,0,0,140,0,0.4,1,0,7,0 53 | 44,1,4,112,290,0,2,153,0,0,1,1,3,2 54 | 44,1,2,130,219,0,2,188,0,0,1,0,3,0 55 | 60,1,4,130,253,0,0,144,1,1.4,1,1,7,1 56 | 54,1,4,124,266,0,2,109,1,2.2,2,1,7,1 57 | 50,1,3,140,233,0,0,163,0,0.6,2,1,7,1 58 | 41,1,4,110,172,0,2,158,0,0,1,0,7,1 59 | 54,1,3,125,273,0,2,152,0,0.5,3,1,3,0 60 | 51,1,1,125,213,0,2,125,1,1.4,1,1,3,0 61 | 51,0,4,130,305,0,0,142,1,1.2,2,0,7,2 62 | 46,0,3,142,177,0,2,160,1,1.4,3,0,3,0 63 | 58,1,4,128,216,0,2,131,1,2.2,2,3,7,1 64 | 54,0,3,135,304,1,0,170,0,0,1,0,3,0 65 | 54,1,4,120,188,0,0,113,0,1.4,2,1,7,2 66 | 60,1,4,145,282,0,2,142,1,2.8,2,2,7,2 67 | 60,1,3,140,185,0,2,155,0,3,2,0,3,1 68 | 54,1,3,150,232,0,2,165,0,1.6,1,0,7,0 69 | 59,1,4,170,326,0,2,140,1,3.4,3,0,7,2 70 | 46,1,3,150,231,0,0,147,0,3.6,2,0,3,1 71 | 65,0,3,155,269,0,0,148,0,0.8,1,0,3,0 72 | 67,1,4,125,254,1,0,163,0,0.2,2,2,7,3 73 | 62,1,4,120,267,0,0,99,1,1.8,2,2,7,1 74 | 65,1,4,110,248,0,2,158,0,0.6,1,2,6,1 75 | 44,1,4,110,197,0,2,177,0,0,1,1,3,1 76 | 65,0,3,160,360,0,2,151,0,0.8,1,0,3,0 77 | 60,1,4,125,258,0,2,141,1,2.8,2,1,7,1 78 | 51,0,3,140,308,0,2,142,0,1.5,1,1,3,0 79 | 48,1,2,130,245,0,2,180,0,0.2,2,0,3,0 80 | 58,1,4,150,270,0,2,111,1,0.8,1,0,7,3 81 | 45,1,4,104,208,0,2,148,1,3,2,0,3,0 82 | 53,0,4,130,264,0,2,143,0,0.4,2,0,3,0 83 | 39,1,3,140,321,0,2,182,0,0,1,0,3,0 84 | 68,1,3,180,274,1,2,150,1,1.6,2,0,7,3 85 | 52,1,2,120,325,0,0,172,0,0.2,1,0,3,0 86 | 44,1,3,140,235,0,2,180,0,0,1,0,3,0 87 | 47,1,3,138,257,0,2,156,0,0,1,0,3,0 88 | 53,0,3,128,216,0,2,115,0,0,1,0,?,0 89 | 53,0,4,138,234,0,2,160,0,0,1,0,3,0 90 | 51,0,3,130,256,0,2,149,0,0.5,1,0,3,0 91 | 66,1,4,120,302,0,2,151,0,0.4,2,0,3,0 92 | 62,0,4,160,164,0,2,145,0,6.2,3,3,7,3 93 | 62,1,3,130,231,0,0,146,0,1.8,2,3,7,0 94 | 44,0,3,108,141,0,0,175,0,0.6,2,0,3,0 95 | 63,0,3,135,252,0,2,172,0,0,1,0,3,0 96 | 52,1,4,128,255,0,0,161,1,0,1,1,7,1 97 | 59,1,4,110,239,0,2,142,1,1.2,2,1,7,2 98 | 60,0,4,150,258,0,2,157,0,2.6,2,2,7,3 99 | 52,1,2,134,201,0,0,158,0,0.8,1,1,3,0 100 | 48,1,4,122,222,0,2,186,0,0,1,0,3,0 101 | 45,1,4,115,260,0,2,185,0,0,1,0,3,0 102 | 34,1,1,118,182,0,2,174,0,0,1,0,3,0 103 | 57,0,4,128,303,0,2,159,0,0,1,1,3,0 104 | 71,0,3,110,265,1,2,130,0,0,1,1,3,0 105 | 49,1,3,120,188,0,0,139,0,2,2,3,7,3 106 | 54,1,2,108,309,0,0,156,0,0,1,0,7,0 107 | 59,1,4,140,177,0,0,162,1,0,1,1,7,2 108 | 57,1,3,128,229,0,2,150,0,0.4,2,1,7,1 109 | 61,1,4,120,260,0,0,140,1,3.6,2,1,7,2 110 | 39,1,4,118,219,0,0,140,0,1.2,2,0,7,3 111 | 61,0,4,145,307,0,2,146,1,1,2,0,7,1 112 | 56,1,4,125,249,1,2,144,1,1.2,2,1,3,1 113 | 52,1,1,118,186,0,2,190,0,0,2,0,6,0 114 | 43,0,4,132,341,1,2,136,1,3,2,0,7,2 115 | 62,0,3,130,263,0,0,97,0,1.2,2,1,7,2 116 | 41,1,2,135,203,0,0,132,0,0,2,0,6,0 117 | 58,1,3,140,211,1,2,165,0,0,1,0,3,0 118 | 35,0,4,138,183,0,0,182,0,1.4,1,0,3,0 119 | 63,1,4,130,330,1,2,132,1,1.8,1,3,7,3 120 | 65,1,4,135,254,0,2,127,0,2.8,2,1,7,2 121 | 48,1,4,130,256,1,2,150,1,0,1,2,7,3 122 | 63,0,4,150,407,0,2,154,0,4,2,3,7,4 123 | 51,1,3,100,222,0,0,143,1,1.2,2,0,3,0 124 | 55,1,4,140,217,0,0,111,1,5.6,3,0,7,3 125 | 65,1,1,138,282,1,2,174,0,1.4,2,1,3,1 126 | 45,0,2,130,234,0,2,175,0,0.6,2,0,3,0 127 | 56,0,4,200,288,1,2,133,1,4,3,2,7,3 128 | 54,1,4,110,239,0,0,126,1,2.8,2,1,7,3 129 | 44,1,2,120,220,0,0,170,0,0,1,0,3,0 130 | 62,0,4,124,209,0,0,163,0,0,1,0,3,0 131 | 54,1,3,120,258,0,2,147,0,0.4,2,0,7,0 132 | 51,1,3,94,227,0,0,154,1,0,1,1,7,0 133 | 29,1,2,130,204,0,2,202,0,0,1,0,3,0 134 | 51,1,4,140,261,0,2,186,1,0,1,0,3,0 135 | 43,0,3,122,213,0,0,165,0,0.2,2,0,3,0 136 | 55,0,2,135,250,0,2,161,0,1.4,2,0,3,0 137 | 70,1,4,145,174,0,0,125,1,2.6,3,0,7,4 138 | 62,1,2,120,281,0,2,103,0,1.4,2,1,7,3 139 | 35,1,4,120,198,0,0,130,1,1.6,2,0,7,1 140 | 51,1,3,125,245,1,2,166,0,2.4,2,0,3,0 141 | 59,1,2,140,221,0,0,164,1,0,1,0,3,0 142 | 59,1,1,170,288,0,2,159,0,0.2,2,0,7,1 143 | 52,1,2,128,205,1,0,184,0,0,1,0,3,0 144 | 64,1,3,125,309,0,0,131,1,1.8,2,0,7,1 145 | 58,1,3,105,240,0,2,154,1,0.6,2,0,7,0 146 | 47,1,3,108,243,0,0,152,0,0,1,0,3,1 147 | 57,1,4,165,289,1,2,124,0,1,2,3,7,4 148 | 41,1,3,112,250,0,0,179,0,0,1,0,3,0 149 | 45,1,2,128,308,0,2,170,0,0,1,0,3,0 150 | 60,0,3,102,318,0,0,160,0,0,1,1,3,0 151 | 52,1,1,152,298,1,0,178,0,1.2,2,0,7,0 152 | 42,0,4,102,265,0,2,122,0,0.6,2,0,3,0 153 | 67,0,3,115,564,0,2,160,0,1.6,2,0,7,0 154 | 55,1,4,160,289,0,2,145,1,0.8,2,1,7,4 155 | 64,1,4,120,246,0,2,96,1,2.2,3,1,3,3 156 | 70,1,4,130,322,0,2,109,0,2.4,2,3,3,1 157 | 51,1,4,140,299,0,0,173,1,1.6,1,0,7,1 158 | 58,1,4,125,300,0,2,171,0,0,1,2,7,1 159 | 60,1,4,140,293,0,2,170,0,1.2,2,2,7,2 160 | 68,1,3,118,277,0,0,151,0,1,1,1,7,0 161 | 46,1,2,101,197,1,0,156,0,0,1,0,7,0 162 | 77,1,4,125,304,0,2,162,1,0,1,3,3,4 163 | 54,0,3,110,214,0,0,158,0,1.6,2,0,3,0 164 | 58,0,4,100,248,0,2,122,0,1,2,0,3,0 165 | 48,1,3,124,255,1,0,175,0,0,1,2,3,0 166 | 57,1,4,132,207,0,0,168,1,0,1,0,7,0 167 | 52,1,3,138,223,0,0,169,0,0,1,?,3,0 168 | 54,0,2,132,288,1,2,159,1,0,1,1,3,0 169 | 35,1,4,126,282,0,2,156,1,0,1,0,7,1 170 | 45,0,2,112,160,0,0,138,0,0,2,0,3,0 171 | 70,1,3,160,269,0,0,112,1,2.9,2,1,7,3 172 | 53,1,4,142,226,0,2,111,1,0,1,0,7,0 173 | 59,0,4,174,249,0,0,143,1,0,2,0,3,1 174 | 62,0,4,140,394,0,2,157,0,1.2,2,0,3,0 175 | 64,1,4,145,212,0,2,132,0,2,2,2,6,4 176 | 57,1,4,152,274,0,0,88,1,1.2,2,1,7,1 177 | 52,1,4,108,233,1,0,147,0,0.1,1,3,7,0 178 | 56,1,4,132,184,0,2,105,1,2.1,2,1,6,1 179 | 43,1,3,130,315,0,0,162,0,1.9,1,1,3,0 180 | 53,1,3,130,246,1,2,173,0,0,1,3,3,0 181 | 48,1,4,124,274,0,2,166,0,0.5,2,0,7,3 182 | 56,0,4,134,409,0,2,150,1,1.9,2,2,7,2 183 | 42,1,1,148,244,0,2,178,0,0.8,1,2,3,0 184 | 59,1,1,178,270,0,2,145,0,4.2,3,0,7,0 185 | 60,0,4,158,305,0,2,161,0,0,1,0,3,1 186 | 63,0,2,140,195,0,0,179,0,0,1,2,3,0 187 | 42,1,3,120,240,1,0,194,0,0.8,3,0,7,0 188 | 66,1,2,160,246,0,0,120,1,0,2,3,6,2 189 | 54,1,2,192,283,0,2,195,0,0,1,1,7,1 190 | 69,1,3,140,254,0,2,146,0,2,2,3,7,2 191 | 50,1,3,129,196,0,0,163,0,0,1,0,3,0 192 | 51,1,4,140,298,0,0,122,1,4.2,2,3,7,3 193 | 43,1,4,132,247,1,2,143,1,0.1,2,?,7,1 194 | 62,0,4,138,294,1,0,106,0,1.9,2,3,3,2 195 | 68,0,3,120,211,0,2,115,0,1.5,2,0,3,0 196 | 67,1,4,100,299,0,2,125,1,0.9,2,2,3,3 197 | 69,1,1,160,234,1,2,131,0,0.1,2,1,3,0 198 | 45,0,4,138,236,0,2,152,1,0.2,2,0,3,0 199 | 50,0,2,120,244,0,0,162,0,1.1,1,0,3,0 200 | 59,1,1,160,273,0,2,125,0,0,1,0,3,1 201 | 50,0,4,110,254,0,2,159,0,0,1,0,3,0 202 | 64,0,4,180,325,0,0,154,1,0,1,0,3,0 203 | 57,1,3,150,126,1,0,173,0,0.2,1,1,7,0 204 | 64,0,3,140,313,0,0,133,0,0.2,1,0,7,0 205 | 43,1,4,110,211,0,0,161,0,0,1,0,7,0 206 | 45,1,4,142,309,0,2,147,1,0,2,3,7,3 207 | 58,1,4,128,259,0,2,130,1,3,2,2,7,3 208 | 50,1,4,144,200,0,2,126,1,0.9,2,0,7,3 209 | 55,1,2,130,262,0,0,155,0,0,1,0,3,0 210 | 62,0,4,150,244,0,0,154,1,1.4,2,0,3,1 211 | 37,0,3,120,215,0,0,170,0,0,1,0,3,0 212 | 38,1,1,120,231,0,0,182,1,3.8,2,0,7,4 213 | 41,1,3,130,214,0,2,168,0,2,2,0,3,0 214 | 66,0,4,178,228,1,0,165,1,1,2,2,7,3 215 | 52,1,4,112,230,0,0,160,0,0,1,1,3,1 216 | 56,1,1,120,193,0,2,162,0,1.9,2,0,7,0 217 | 46,0,2,105,204,0,0,172,0,0,1,0,3,0 218 | 46,0,4,138,243,0,2,152,1,0,2,0,3,0 219 | 64,0,4,130,303,0,0,122,0,2,2,2,3,0 220 | 59,1,4,138,271,0,2,182,0,0,1,0,3,0 221 | 41,0,3,112,268,0,2,172,1,0,1,0,3,0 222 | 54,0,3,108,267,0,2,167,0,0,1,0,3,0 223 | 39,0,3,94,199,0,0,179,0,0,1,0,3,0 224 | 53,1,4,123,282,0,0,95,1,2,2,2,7,3 225 | 63,0,4,108,269,0,0,169,1,1.8,2,2,3,1 226 | 34,0,2,118,210,0,0,192,0,0.7,1,0,3,0 227 | 47,1,4,112,204,0,0,143,0,0.1,1,0,3,0 228 | 67,0,3,152,277,0,0,172,0,0,1,1,3,0 229 | 54,1,4,110,206,0,2,108,1,0,2,1,3,3 230 | 66,1,4,112,212,0,2,132,1,0.1,1,1,3,2 231 | 52,0,3,136,196,0,2,169,0,0.1,2,0,3,0 232 | 55,0,4,180,327,0,1,117,1,3.4,2,0,3,2 233 | 49,1,3,118,149,0,2,126,0,0.8,1,3,3,1 234 | 74,0,2,120,269,0,2,121,1,0.2,1,1,3,0 235 | 54,0,3,160,201,0,0,163,0,0,1,1,3,0 236 | 54,1,4,122,286,0,2,116,1,3.2,2,2,3,3 237 | 56,1,4,130,283,1,2,103,1,1.6,3,0,7,2 238 | 46,1,4,120,249,0,2,144,0,0.8,1,0,7,1 239 | 49,0,2,134,271,0,0,162,0,0,2,0,3,0 240 | 42,1,2,120,295,0,0,162,0,0,1,0,3,0 241 | 41,1,2,110,235,0,0,153,0,0,1,0,3,0 242 | 41,0,2,126,306,0,0,163,0,0,1,0,3,0 243 | 49,0,4,130,269,0,0,163,0,0,1,0,3,0 244 | 61,1,1,134,234,0,0,145,0,2.6,2,2,3,2 245 | 60,0,3,120,178,1,0,96,0,0,1,0,3,0 246 | 67,1,4,120,237,0,0,71,0,1,2,0,3,2 247 | 58,1,4,100,234,0,0,156,0,0.1,1,1,7,2 248 | 47,1,4,110,275,0,2,118,1,1,2,1,3,1 249 | 52,1,4,125,212,0,0,168,0,1,1,2,7,3 250 | 62,1,2,128,208,1,2,140,0,0,1,0,3,0 251 | 57,1,4,110,201,0,0,126,1,1.5,2,0,6,0 252 | 58,1,4,146,218,0,0,105,0,2,2,1,7,1 253 | 64,1,4,128,263,0,0,105,1,0.2,2,1,7,0 254 | 51,0,3,120,295,0,2,157,0,0.6,1,0,3,0 255 | 43,1,4,115,303,0,0,181,0,1.2,2,0,3,0 256 | 42,0,3,120,209,0,0,173,0,0,2,0,3,0 257 | 67,0,4,106,223,0,0,142,0,0.3,1,2,3,0 258 | 76,0,3,140,197,0,1,116,0,1.1,2,0,3,0 259 | 70,1,2,156,245,0,2,143,0,0,1,0,3,0 260 | 57,1,2,124,261,0,0,141,0,0.3,1,0,7,1 261 | 44,0,3,118,242,0,0,149,0,0.3,2,1,3,0 262 | 58,0,2,136,319,1,2,152,0,0,1,2,3,3 263 | 60,0,1,150,240,0,0,171,0,0.9,1,0,3,0 264 | 44,1,3,120,226,0,0,169,0,0,1,0,3,0 265 | 61,1,4,138,166,0,2,125,1,3.6,2,1,3,4 266 | 42,1,4,136,315,0,0,125,1,1.8,2,0,6,2 267 | 52,1,4,128,204,1,0,156,1,1,2,0,?,2 268 | 59,1,3,126,218,1,0,134,0,2.2,2,1,6,2 269 | 40,1,4,152,223,0,0,181,0,0,1,0,7,1 270 | 42,1,3,130,180,0,0,150,0,0,1,0,3,0 271 | 61,1,4,140,207,0,2,138,1,1.9,1,1,7,1 272 | 66,1,4,160,228,0,2,138,0,2.3,1,0,6,0 273 | 46,1,4,140,311,0,0,120,1,1.8,2,2,7,2 274 | 71,0,4,112,149,0,0,125,0,1.6,2,0,3,0 275 | 59,1,1,134,204,0,0,162,0,0.8,1,2,3,1 276 | 64,1,1,170,227,0,2,155,0,0.6,2,0,7,0 277 | 66,0,3,146,278,0,2,152,0,0,2,1,3,0 278 | 39,0,3,138,220,0,0,152,0,0,2,0,3,0 279 | 57,1,2,154,232,0,2,164,0,0,1,1,3,1 280 | 58,0,4,130,197,0,0,131,0,0.6,2,0,3,0 281 | 57,1,4,110,335,0,0,143,1,3,2,1,7,2 282 | 47,1,3,130,253,0,0,179,0,0,1,0,3,0 283 | 55,0,4,128,205,0,1,130,1,2,2,1,7,3 284 | 35,1,2,122,192,0,0,174,0,0,1,0,3,0 285 | 61,1,4,148,203,0,0,161,0,0,1,1,7,2 286 | 58,1,4,114,318,0,1,140,0,4.4,3,3,6,4 287 | 58,0,4,170,225,1,2,146,1,2.8,2,2,6,2 288 | 58,1,2,125,220,0,0,144,0,0.4,2,?,7,0 289 | 56,1,2,130,221,0,2,163,0,0,1,0,7,0 290 | 56,1,2,120,240,0,0,169,0,0,3,0,3,0 291 | 67,1,3,152,212,0,2,150,0,0.8,2,0,7,1 292 | 55,0,2,132,342,0,0,166,0,1.2,1,0,3,0 293 | 44,1,4,120,169,0,0,144,1,2.8,3,0,6,2 294 | 63,1,4,140,187,0,2,144,1,4,1,2,7,2 295 | 63,0,4,124,197,0,0,136,1,0,2,0,3,1 296 | 41,1,2,120,157,0,0,182,0,0,1,0,3,0 297 | 59,1,4,164,176,1,2,90,0,1,2,2,6,3 298 | 57,0,4,140,241,0,0,123,1,0.2,2,0,7,1 299 | 45,1,1,110,264,0,0,132,0,1.2,2,0,7,1 300 | 68,1,4,144,193,1,0,141,0,3.4,2,2,7,2 301 | 57,1,4,130,131,0,0,115,1,1.2,2,1,7,3 302 | 57,0,2,130,236,0,2,174,0,0,2,1,3,1 303 | 38,1,3,138,175,0,0,173,0,0,1,?,3,0 304 | -------------------------------------------------------------------------------- /Description about Data.txt: -------------------------------------------------------------------------------- 1 | Here 4 stages , diseased or not and also 2 stages 2 | 1st row - age 3 | 2 row - male or female (1 - male) 4 | 3 - chest pain CP 5 | cp: chest pain type 6 | -- Value 1: typical angina(Chest portion) 7 | -- Value 2: atypical angina 8 | -- Value 3: non-anginal pain 9 | -- Value 4: asymptomatic 10 | 4 - trestbps: resting blood pressure (in mm Hg on admission to the 11 | hospital) 12 | 5 - chol: serum cholestoral in mg/dl 13 | 6 - fbs: (fasting blood sugar > 120 mg/dl) (1 = true; 0 = false) 14 | 7 - restecg: resting electrocardiographic results 15 | -- Value 0: normal 16 | -- Value 1: having ST-T wave abnormality (T wave inversions and/or ST 17 | elevation or depression of > 0.05 mV) 18 | -- Value 2: showing probable or definite left ventricular hypertrophy 19 | by Estes' criteria 20 | 8 - thalach: maximum heart rate achieved 21 | 9 - exang: exercise induced angina (1 = yes; 0 = no) 22 | 10 - oldpeak = ST depression induced by exercise relative to rest 23 | 11 - slope: the slope of the peak exercise ST segment 24 | -- Value 1: upsloping 25 | -- Value 2: flat 26 | -- Value 3: downsloping 27 | 28 | 12 - ca: number of major vessels (0-3) colored by flourosopy 29 | 13 - thal: 3 = normal; 6 = fixed defect; 7 = reversable defect 30 | 14 - num: diagnosis of heart disease (angiographic disease status) 31 | -- Value 0: < 50% diameter narrowing 32 | -- Value 1: > 50% diameter narrowing 33 | (in any major vessel: attributes 59 through 68 are vessels) 34 | -------------------------------------------------------------------------------- /HeartDiseasePredictor.py: -------------------------------------------------------------------------------- 1 | from numpy import genfromtxt 2 | import numpy as np 3 | from numpy import * 4 | import matplotlib 5 | #matplotlib.use('TKAgg') # matplotlib renderer for windows 6 | 7 | import matplotlib.pyplot as plt 8 | 9 | 10 | from sklearn.svm import LinearSVC 11 | from sklearn.decomposition import PCA 12 | import pylab as pl 13 | from itertools import cycle 14 | from sklearn import cross_validation 15 | from sklearn.svm import SVC 16 | 17 | # After imorting all the necessary packages now 18 | #Loading the data and pruning it 19 | dataset = genfromtxt('D:\Python\Heart Disease\cdata.csv',delimiter=',') 20 | 21 | #Printing the datasetd 22 | X = dataset[:,0:12] #Feature set 23 | Y = dataset[:,13] #label Set 24 | 25 | #Replacing 1-4 by label 1 tesko arthaat # Item with 0 value is already indexed as 0 , so rest are indexed as 1 26 | for index, item in enumerate(Y): # Last row gives 4 diff types of output , so convert them to 0 or 1 27 | if not (item == 0.0): # that is either Yes or No 28 | Y[index] = 1 29 | print(Y) 30 | target_names = ['0','1'] 31 | 32 | 33 | # PLOTTING part starts 34 | 35 | #Method to plot the graph for reduced Dimensions 36 | def plot_2D(data,target,target_names): 37 | colors = cycle('rgbcmykw') 38 | target_ids = range(len(target_names)) 39 | plt.figure() 40 | for i,c, label in zip(target_ids, colors, target_names): 41 | plt.scatter(data[target == i, 0], data[target == i, 1], c=c, label=label) 42 | plt.legend() 43 | plt.savefig('Problem 2 Graph') 44 | 45 | # TIME FOR SVM 46 | # Classifying the data using a linear SVM and perdicting the probabilities of disease belonging to a particular classs 47 | 48 | modelSVM = LinearSVC(C=0.1) 49 | pca = PCA(n_components=2, whiten=True).fit(X) # n denotes number of components to keep after Dimensionality Reduction 50 | X_new = pca.transform(X) 51 | 52 | #Calling the above defined function plot_2D 53 | plot_2D(X_new, Y, target_names) 54 | 55 | # Applying cross validation on the training and test set for validating our linear SVM model 56 | X_train,X_test,Y_train,Y_test = cross_validation.train_test_split(X_new, Y, test_size = 0.2, train_size=0.8, random_state=0) 57 | modelSVM = modelSVM.fit(X_train,Y_train) 58 | print("Linear SVC values with Split") 59 | print(modelSVM.score(X_test, Y_test)) 60 | 61 | 62 | 63 | modelSVMRaw = LinearSVC(C = 0.1) 64 | modelSVMRaw = modelSVMRaw.fit(X_new, Y) 65 | cnt = 0 66 | for i in modelSVMRaw.predict(X_new): 67 | if(i == Y[1]): 68 | cnt = cnt+1 69 | print("Linear SVC score without split") 70 | print(float(cnt)/101) 71 | 72 | # Applying the PCA on the data features 73 | modelSVM2 = SVC(C = 0.1,kernel='rbf') 74 | 75 | # Applying the cross validation on training and the test set for validating our linear SVM model 76 | X_train1,X_test1,Y_train1,Y_test1 = cross_validation.train_test_split(X_new, Y, test_size = 0.2, train_size=0.1, random_state=0) 77 | modelSVM2 = modelSVM2.fit(X_train1,Y_train1) 78 | print("RBF score with split") 79 | print(modelSVM2.score(X_test1,Y_test1)) 80 | 81 | 82 | modelSVMRaw2 = SVC(C=0.1, kernel='rbf') 83 | modelSVMRaw2 = modelSVMRaw2.fit(X_new,Y) 84 | cnt1 = 0 85 | for i in modelSVMRaw2.predict(X_new): 86 | if i == Y[1]: 87 | cnt1 = cnt1 + 1 88 | print("RBF score without split") 89 | print(float(cnt1)/298) 90 | 91 | 92 | 93 | # Only perform 2 algorithms 94 | 95 | # creating the mest plots 96 | X_min, X_max = X_new[:,0].min() - 1, X_new[:,0].max() + 1 97 | Y_min, Y_max = X_new[:,1].min() - 1, X_new[:,1].max() + 1 98 | xx, yy = np.meshgrid(np.arange(X_min, X_max,0.2), 99 | np.arange(Y_min, Y_max,0.2)) 100 | 101 | #Titles for the plot 102 | titles = "SVC ( RBF kernel) - Plotting highest varied 2 PCA values" 103 | 104 | # PLot the decision boundary . For that we'l; assign a color to each 105 | # point in the mesh 106 | plt .subplot(2,2, i + 1) 107 | plt.subplots_adjust(wspace = 0.4, hspace=0.4) 108 | Z = modelSVM2.predict(np.c_[xx.ravel(), yy.ravel()]) 109 | 110 | 111 | #Put the result into a color plot 112 | Z = Z.reshape(xx.shape) 113 | plt.contourf(xx,yy,Z,cmap=plt.cm.Paired, alpha=0.1) 114 | 115 | #plot also the color points 116 | plt.scatter(X_new[:,0], X_new[:,1], c=Y, cmap = plt.cm.Paired) 117 | plt.xlabel("PCA1") 118 | plt.ylabel("PCA2") 119 | plt.xlim(xx.min(),xx.max()) 120 | plt.ylim(yy.min(),yy.max()) 121 | plt.xticks(()) 122 | plt.yticks(()) 123 | plt.title(titles) 124 | plt.show() 125 | 126 | -------------------------------------------------------------------------------- /MissingValueFinder.py: -------------------------------------------------------------------------------- 1 | # If you have better solution feel free to make Pull Request ! 2 | 3 | from numpy import * 4 | # remember row in excel is column in real life 5 | # Just change the row name to find whether in a particular row has empty elements or not . Eg row[11] 6 | import csv 7 | 8 | inp = open('D:\Python\Heart Disease\original.csv','r') 9 | out = open('D:\Python\Heart Disease\original1.csv','w') 10 | 11 | writer = csv.writer(out) 12 | 13 | for row in csv.reader(inp): 14 | if(row[11] >= "0" and row[12] >= "0"): 15 | writer.writerow(row) 16 | print(out) 17 | inp.close() 18 | out.close() 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /Output Graph Saved.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RoshanADK/Heart-disease-prediction-system-in-python-using-Support-vector-machine-and-PCA/10e7ef84a9ab94c44b6b6bdca46d53e97c640b0c/Output Graph Saved.png -------------------------------------------------------------------------------- /Processed Data with No Empty Values.csv: -------------------------------------------------------------------------------- 1 | 63,1,1,145,233,1,2,150,0,2.3,3,0,6,0 2 | 67,1,4,160,286,0,2,108,1,1.5,2,3,3,2 3 | 67,1,4,120,229,0,2,129,1,2.6,2,2,7,1 4 | 37,1,3,130,250,0,0,187,0,3.5,3,0,3,0 5 | 41,0,2,130,204,0,2,172,0,1.4,1,0,3,0 6 | 56,1,2,120,236,0,0,178,0,0.8,1,0,3,0 7 | 62,0,4,140,268,0,2,160,0,3.6,3,2,3,3 8 | 57,0,4,120,354,0,0,163,1,0.6,1,0,3,0 9 | 63,1,4,130,254,0,2,147,0,1.4,2,1,7,2 10 | 53,1,4,140,203,1,2,155,1,3.1,3,0,7,1 11 | 57,1,4,140,192,0,0,148,0,0.4,2,0,6,0 12 | 56,0,2,140,294,0,2,153,0,1.3,2,0,3,0 13 | 56,1,3,130,256,1,2,142,1,0.6,2,1,6,2 14 | 44,1,2,120,263,0,0,173,0,0,1,0,7,0 15 | 52,1,3,172,199,1,0,162,0,0.5,1,0,7,0 16 | 57,1,3,150,168,0,0,174,0,1.6,1,0,3,0 17 | 48,1,2,110,229,0,0,168,0,1,3,0,7,1 18 | 54,1,4,140,239,0,0,160,0,1.2,1,0,3,0 19 | 48,0,3,130,275,0,0,139,0,0.2,1,0,3,0 20 | 49,1,2,130,266,0,0,171,0,0.6,1,0,3,0 21 | 64,1,1,110,211,0,2,144,1,1.8,2,0,3,0 22 | 58,0,1,150,283,1,2,162,0,1,1,0,3,0 23 | 58,1,2,120,284,0,2,160,0,1.8,2,0,3,1 24 | 58,1,3,132,224,0,2,173,0,3.2,1,2,7,3 25 | 60,1,4,130,206,0,2,132,1,2.4,2,2,7,4 26 | 50,0,3,120,219,0,0,158,0,1.6,2,0,3,0 27 | 58,0,3,120,340,0,0,172,0,0,1,0,3,0 28 | 66,0,1,150,226,0,0,114,0,2.6,3,0,3,0 29 | 43,1,4,150,247,0,0,171,0,1.5,1,0,3,0 30 | 40,1,4,110,167,0,2,114,1,2,2,0,7,3 31 | 69,0,1,140,239,0,0,151,0,1.8,1,2,3,0 32 | 60,1,4,117,230,1,0,160,1,1.4,1,2,7,2 33 | 64,1,3,140,335,0,0,158,0,0,1,0,3,1 34 | 59,1,4,135,234,0,0,161,0,0.5,2,0,7,0 35 | 44,1,3,130,233,0,0,179,1,0.4,1,0,3,0 36 | 42,1,4,140,226,0,0,178,0,0,1,0,3,0 37 | 43,1,4,120,177,0,2,120,1,2.5,2,0,7,3 38 | 57,1,4,150,276,0,2,112,1,0.6,2,1,6,1 39 | 55,1,4,132,353,0,0,132,1,1.2,2,1,7,3 40 | 61,1,3,150,243,1,0,137,1,1,2,0,3,0 41 | 65,0,4,150,225,0,2,114,0,1,2,3,7,4 42 | 40,1,1,140,199,0,0,178,1,1.4,1,0,7,0 43 | 71,0,2,160,302,0,0,162,0,0.4,1,2,3,0 44 | 59,1,3,150,212,1,0,157,0,1.6,1,0,3,0 45 | 61,0,4,130,330,0,2,169,0,0,1,0,3,1 46 | 58,1,3,112,230,0,2,165,0,2.5,2,1,7,4 47 | 51,1,3,110,175,0,0,123,0,0.6,1,0,3,0 48 | 50,1,4,150,243,0,2,128,0,2.6,2,0,7,4 49 | 65,0,3,140,417,1,2,157,0,0.8,1,1,3,0 50 | 53,1,3,130,197,1,2,152,0,1.2,3,0,3,0 51 | 41,0,2,105,198,0,0,168,0,0,1,1,3,0 52 | 65,1,4,120,177,0,0,140,0,0.4,1,0,7,0 53 | 44,1,4,112,290,0,2,153,0,0,1,1,3,2 54 | 44,1,2,130,219,0,2,188,0,0,1,0,3,0 55 | 60,1,4,130,253,0,0,144,1,1.4,1,1,7,1 56 | 54,1,4,124,266,0,2,109,1,2.2,2,1,7,1 57 | 50,1,3,140,233,0,0,163,0,0.6,2,1,7,1 58 | 41,1,4,110,172,0,2,158,0,0,1,0,7,1 59 | 54,1,3,125,273,0,2,152,0,0.5,3,1,3,0 60 | 51,1,1,125,213,0,2,125,1,1.4,1,1,3,0 61 | 51,0,4,130,305,0,0,142,1,1.2,2,0,7,2 62 | 46,0,3,142,177,0,2,160,1,1.4,3,0,3,0 63 | 58,1,4,128,216,0,2,131,1,2.2,2,3,7,1 64 | 54,0,3,135,304,1,0,170,0,0,1,0,3,0 65 | 54,1,4,120,188,0,0,113,0,1.4,2,1,7,2 66 | 60,1,4,145,282,0,2,142,1,2.8,2,2,7,2 67 | 60,1,3,140,185,0,2,155,0,3,2,0,3,1 68 | 54,1,3,150,232,0,2,165,0,1.6,1,0,7,0 69 | 59,1,4,170,326,0,2,140,1,3.4,3,0,7,2 70 | 46,1,3,150,231,0,0,147,0,3.6,2,0,3,1 71 | 65,0,3,155,269,0,0,148,0,0.8,1,0,3,0 72 | 67,1,4,125,254,1,0,163,0,0.2,2,2,7,3 73 | 62,1,4,120,267,0,0,99,1,1.8,2,2,7,1 74 | 65,1,4,110,248,0,2,158,0,0.6,1,2,6,1 75 | 44,1,4,110,197,0,2,177,0,0,1,1,3,1 76 | 65,0,3,160,360,0,2,151,0,0.8,1,0,3,0 77 | 60,1,4,125,258,0,2,141,1,2.8,2,1,7,1 78 | 51,0,3,140,308,0,2,142,0,1.5,1,1,3,0 79 | 48,1,2,130,245,0,2,180,0,0.2,2,0,3,0 80 | 58,1,4,150,270,0,2,111,1,0.8,1,0,7,3 81 | 45,1,4,104,208,0,2,148,1,3,2,0,3,0 82 | 53,0,4,130,264,0,2,143,0,0.4,2,0,3,0 83 | 39,1,3,140,321,0,2,182,0,0,1,0,3,0 84 | 68,1,3,180,274,1,2,150,1,1.6,2,0,7,3 85 | 52,1,2,120,325,0,0,172,0,0.2,1,0,3,0 86 | 44,1,3,140,235,0,2,180,0,0,1,0,3,0 87 | 47,1,3,138,257,0,2,156,0,0,1,0,3,0 88 | 53,0,4,138,234,0,2,160,0,0,1,0,3,0 89 | 51,0,3,130,256,0,2,149,0,0.5,1,0,3,0 90 | 66,1,4,120,302,0,2,151,0,0.4,2,0,3,0 91 | 62,0,4,160,164,0,2,145,0,6.2,3,3,7,3 92 | 62,1,3,130,231,0,0,146,0,1.8,2,3,7,0 93 | 44,0,3,108,141,0,0,175,0,0.6,2,0,3,0 94 | 63,0,3,135,252,0,2,172,0,0,1,0,3,0 95 | 52,1,4,128,255,0,0,161,1,0,1,1,7,1 96 | 59,1,4,110,239,0,2,142,1,1.2,2,1,7,2 97 | 60,0,4,150,258,0,2,157,0,2.6,2,2,7,3 98 | 52,1,2,134,201,0,0,158,0,0.8,1,1,3,0 99 | 48,1,4,122,222,0,2,186,0,0,1,0,3,0 100 | 45,1,4,115,260,0,2,185,0,0,1,0,3,0 101 | 34,1,1,118,182,0,2,174,0,0,1,0,3,0 102 | 57,0,4,128,303,0,2,159,0,0,1,1,3,0 103 | 71,0,3,110,265,1,2,130,0,0,1,1,3,0 104 | 49,1,3,120,188,0,0,139,0,2,2,3,7,3 105 | 54,1,2,108,309,0,0,156,0,0,1,0,7,0 106 | 59,1,4,140,177,0,0,162,1,0,1,1,7,2 107 | 57,1,3,128,229,0,2,150,0,0.4,2,1,7,1 108 | 61,1,4,120,260,0,0,140,1,3.6,2,1,7,2 109 | 39,1,4,118,219,0,0,140,0,1.2,2,0,7,3 110 | 61,0,4,145,307,0,2,146,1,1,2,0,7,1 111 | 56,1,4,125,249,1,2,144,1,1.2,2,1,3,1 112 | 52,1,1,118,186,0,2,190,0,0,2,0,6,0 113 | 43,0,4,132,341,1,2,136,1,3,2,0,7,2 114 | 62,0,3,130,263,0,0,97,0,1.2,2,1,7,2 115 | 41,1,2,135,203,0,0,132,0,0,2,0,6,0 116 | 58,1,3,140,211,1,2,165,0,0,1,0,3,0 117 | 35,0,4,138,183,0,0,182,0,1.4,1,0,3,0 118 | 63,1,4,130,330,1,2,132,1,1.8,1,3,7,3 119 | 65,1,4,135,254,0,2,127,0,2.8,2,1,7,2 120 | 48,1,4,130,256,1,2,150,1,0,1,2,7,3 121 | 63,0,4,150,407,0,2,154,0,4,2,3,7,4 122 | 51,1,3,100,222,0,0,143,1,1.2,2,0,3,0 123 | 55,1,4,140,217,0,0,111,1,5.6,3,0,7,3 124 | 65,1,1,138,282,1,2,174,0,1.4,2,1,3,1 125 | 45,0,2,130,234,0,2,175,0,0.6,2,0,3,0 126 | 56,0,4,200,288,1,2,133,1,4,3,2,7,3 127 | 54,1,4,110,239,0,0,126,1,2.8,2,1,7,3 128 | 44,1,2,120,220,0,0,170,0,0,1,0,3,0 129 | 62,0,4,124,209,0,0,163,0,0,1,0,3,0 130 | 54,1,3,120,258,0,2,147,0,0.4,2,0,7,0 131 | 51,1,3,94,227,0,0,154,1,0,1,1,7,0 132 | 29,1,2,130,204,0,2,202,0,0,1,0,3,0 133 | 51,1,4,140,261,0,2,186,1,0,1,0,3,0 134 | 43,0,3,122,213,0,0,165,0,0.2,2,0,3,0 135 | 55,0,2,135,250,0,2,161,0,1.4,2,0,3,0 136 | 70,1,4,145,174,0,0,125,1,2.6,3,0,7,4 137 | 62,1,2,120,281,0,2,103,0,1.4,2,1,7,3 138 | 35,1,4,120,198,0,0,130,1,1.6,2,0,7,1 139 | 51,1,3,125,245,1,2,166,0,2.4,2,0,3,0 140 | 59,1,2,140,221,0,0,164,1,0,1,0,3,0 141 | 59,1,1,170,288,0,2,159,0,0.2,2,0,7,1 142 | 52,1,2,128,205,1,0,184,0,0,1,0,3,0 143 | 64,1,3,125,309,0,0,131,1,1.8,2,0,7,1 144 | 58,1,3,105,240,0,2,154,1,0.6,2,0,7,0 145 | 47,1,3,108,243,0,0,152,0,0,1,0,3,1 146 | 57,1,4,165,289,1,2,124,0,1,2,3,7,4 147 | 41,1,3,112,250,0,0,179,0,0,1,0,3,0 148 | 45,1,2,128,308,0,2,170,0,0,1,0,3,0 149 | 60,0,3,102,318,0,0,160,0,0,1,1,3,0 150 | 52,1,1,152,298,1,0,178,0,1.2,2,0,7,0 151 | 42,0,4,102,265,0,2,122,0,0.6,2,0,3,0 152 | 67,0,3,115,564,0,2,160,0,1.6,2,0,7,0 153 | 55,1,4,160,289,0,2,145,1,0.8,2,1,7,4 154 | 64,1,4,120,246,0,2,96,1,2.2,3,1,3,3 155 | 70,1,4,130,322,0,2,109,0,2.4,2,3,3,1 156 | 51,1,4,140,299,0,0,173,1,1.6,1,0,7,1 157 | 58,1,4,125,300,0,2,171,0,0,1,2,7,1 158 | 60,1,4,140,293,0,2,170,0,1.2,2,2,7,2 159 | 68,1,3,118,277,0,0,151,0,1,1,1,7,0 160 | 46,1,2,101,197,1,0,156,0,0,1,0,7,0 161 | 77,1,4,125,304,0,2,162,1,0,1,3,3,4 162 | 54,0,3,110,214,0,0,158,0,1.6,2,0,3,0 163 | 58,0,4,100,248,0,2,122,0,1,2,0,3,0 164 | 48,1,3,124,255,1,0,175,0,0,1,2,3,0 165 | 57,1,4,132,207,0,0,168,1,0,1,0,7,0 166 | 54,0,2,132,288,1,2,159,1,0,1,1,3,0 167 | 35,1,4,126,282,0,2,156,1,0,1,0,7,1 168 | 45,0,2,112,160,0,0,138,0,0,2,0,3,0 169 | 70,1,3,160,269,0,0,112,1,2.9,2,1,7,3 170 | 53,1,4,142,226,0,2,111,1,0,1,0,7,0 171 | 59,0,4,174,249,0,0,143,1,0,2,0,3,1 172 | 62,0,4,140,394,0,2,157,0,1.2,2,0,3,0 173 | 64,1,4,145,212,0,2,132,0,2,2,2,6,4 174 | 57,1,4,152,274,0,0,88,1,1.2,2,1,7,1 175 | 52,1,4,108,233,1,0,147,0,0.1,1,3,7,0 176 | 56,1,4,132,184,0,2,105,1,2.1,2,1,6,1 177 | 43,1,3,130,315,0,0,162,0,1.9,1,1,3,0 178 | 53,1,3,130,246,1,2,173,0,0,1,3,3,0 179 | 48,1,4,124,274,0,2,166,0,0.5,2,0,7,3 180 | 56,0,4,134,409,0,2,150,1,1.9,2,2,7,2 181 | 42,1,1,148,244,0,2,178,0,0.8,1,2,3,0 182 | 59,1,1,178,270,0,2,145,0,4.2,3,0,7,0 183 | 60,0,4,158,305,0,2,161,0,0,1,0,3,1 184 | 63,0,2,140,195,0,0,179,0,0,1,2,3,0 185 | 42,1,3,120,240,1,0,194,0,0.8,3,0,7,0 186 | 66,1,2,160,246,0,0,120,1,0,2,3,6,2 187 | 54,1,2,192,283,0,2,195,0,0,1,1,7,1 188 | 69,1,3,140,254,0,2,146,0,2,2,3,7,2 189 | 50,1,3,129,196,0,0,163,0,0,1,0,3,0 190 | 51,1,4,140,298,0,0,122,1,4.2,2,3,7,3 191 | 62,0,4,138,294,1,0,106,0,1.9,2,3,3,2 192 | 68,0,3,120,211,0,2,115,0,1.5,2,0,3,0 193 | 67,1,4,100,299,0,2,125,1,0.9,2,2,3,3 194 | 69,1,1,160,234,1,2,131,0,0.1,2,1,3,0 195 | 45,0,4,138,236,0,2,152,1,0.2,2,0,3,0 196 | 50,0,2,120,244,0,0,162,0,1.1,1,0,3,0 197 | 59,1,1,160,273,0,2,125,0,0,1,0,3,1 198 | 50,0,4,110,254,0,2,159,0,0,1,0,3,0 199 | 64,0,4,180,325,0,0,154,1,0,1,0,3,0 200 | 57,1,3,150,126,1,0,173,0,0.2,1,1,7,0 201 | 64,0,3,140,313,0,0,133,0,0.2,1,0,7,0 202 | 43,1,4,110,211,0,0,161,0,0,1,0,7,0 203 | 45,1,4,142,309,0,2,147,1,0,2,3,7,3 204 | 58,1,4,128,259,0,2,130,1,3,2,2,7,3 205 | 50,1,4,144,200,0,2,126,1,0.9,2,0,7,3 206 | 55,1,2,130,262,0,0,155,0,0,1,0,3,0 207 | 62,0,4,150,244,0,0,154,1,1.4,2,0,3,1 208 | 37,0,3,120,215,0,0,170,0,0,1,0,3,0 209 | 38,1,1,120,231,0,0,182,1,3.8,2,0,7,4 210 | 41,1,3,130,214,0,2,168,0,2,2,0,3,0 211 | 66,0,4,178,228,1,0,165,1,1,2,2,7,3 212 | 52,1,4,112,230,0,0,160,0,0,1,1,3,1 213 | 56,1,1,120,193,0,2,162,0,1.9,2,0,7,0 214 | 46,0,2,105,204,0,0,172,0,0,1,0,3,0 215 | 46,0,4,138,243,0,2,152,1,0,2,0,3,0 216 | 64,0,4,130,303,0,0,122,0,2,2,2,3,0 217 | 59,1,4,138,271,0,2,182,0,0,1,0,3,0 218 | 41,0,3,112,268,0,2,172,1,0,1,0,3,0 219 | 54,0,3,108,267,0,2,167,0,0,1,0,3,0 220 | 39,0,3,94,199,0,0,179,0,0,1,0,3,0 221 | 53,1,4,123,282,0,0,95,1,2,2,2,7,3 222 | 63,0,4,108,269,0,0,169,1,1.8,2,2,3,1 223 | 34,0,2,118,210,0,0,192,0,0.7,1,0,3,0 224 | 47,1,4,112,204,0,0,143,0,0.1,1,0,3,0 225 | 67,0,3,152,277,0,0,172,0,0,1,1,3,0 226 | 54,1,4,110,206,0,2,108,1,0,2,1,3,3 227 | 66,1,4,112,212,0,2,132,1,0.1,1,1,3,2 228 | 52,0,3,136,196,0,2,169,0,0.1,2,0,3,0 229 | 55,0,4,180,327,0,1,117,1,3.4,2,0,3,2 230 | 49,1,3,118,149,0,2,126,0,0.8,1,3,3,1 231 | 74,0,2,120,269,0,2,121,1,0.2,1,1,3,0 232 | 54,0,3,160,201,0,0,163,0,0,1,1,3,0 233 | 54,1,4,122,286,0,2,116,1,3.2,2,2,3,3 234 | 56,1,4,130,283,1,2,103,1,1.6,3,0,7,2 235 | 46,1,4,120,249,0,2,144,0,0.8,1,0,7,1 236 | 49,0,2,134,271,0,0,162,0,0,2,0,3,0 237 | 42,1,2,120,295,0,0,162,0,0,1,0,3,0 238 | 41,1,2,110,235,0,0,153,0,0,1,0,3,0 239 | 41,0,2,126,306,0,0,163,0,0,1,0,3,0 240 | 49,0,4,130,269,0,0,163,0,0,1,0,3,0 241 | 61,1,1,134,234,0,0,145,0,2.6,2,2,3,2 242 | 60,0,3,120,178,1,0,96,0,0,1,0,3,0 243 | 67,1,4,120,237,0,0,71,0,1,2,0,3,2 244 | 58,1,4,100,234,0,0,156,0,0.1,1,1,7,2 245 | 47,1,4,110,275,0,2,118,1,1,2,1,3,1 246 | 52,1,4,125,212,0,0,168,0,1,1,2,7,3 247 | 62,1,2,128,208,1,2,140,0,0,1,0,3,0 248 | 57,1,4,110,201,0,0,126,1,1.5,2,0,6,0 249 | 58,1,4,146,218,0,0,105,0,2,2,1,7,1 250 | 64,1,4,128,263,0,0,105,1,0.2,2,1,7,0 251 | 51,0,3,120,295,0,2,157,0,0.6,1,0,3,0 252 | 43,1,4,115,303,0,0,181,0,1.2,2,0,3,0 253 | 42,0,3,120,209,0,0,173,0,0,2,0,3,0 254 | 67,0,4,106,223,0,0,142,0,0.3,1,2,3,0 255 | 76,0,3,140,197,0,1,116,0,1.1,2,0,3,0 256 | 70,1,2,156,245,0,2,143,0,0,1,0,3,0 257 | 57,1,2,124,261,0,0,141,0,0.3,1,0,7,1 258 | 44,0,3,118,242,0,0,149,0,0.3,2,1,3,0 259 | 58,0,2,136,319,1,2,152,0,0,1,2,3,3 260 | 60,0,1,150,240,0,0,171,0,0.9,1,0,3,0 261 | 44,1,3,120,226,0,0,169,0,0,1,0,3,0 262 | 61,1,4,138,166,0,2,125,1,3.6,2,1,3,4 263 | 42,1,4,136,315,0,0,125,1,1.8,2,0,6,2 264 | 59,1,3,126,218,1,0,134,0,2.2,2,1,6,2 265 | 40,1,4,152,223,0,0,181,0,0,1,0,7,1 266 | 42,1,3,130,180,0,0,150,0,0,1,0,3,0 267 | 61,1,4,140,207,0,2,138,1,1.9,1,1,7,1 268 | 66,1,4,160,228,0,2,138,0,2.3,1,0,6,0 269 | 46,1,4,140,311,0,0,120,1,1.8,2,2,7,2 270 | 71,0,4,112,149,0,0,125,0,1.6,2,0,3,0 271 | 59,1,1,134,204,0,0,162,0,0.8,1,2,3,1 272 | 64,1,1,170,227,0,2,155,0,0.6,2,0,7,0 273 | 66,0,3,146,278,0,2,152,0,0,2,1,3,0 274 | 39,0,3,138,220,0,0,152,0,0,2,0,3,0 275 | 57,1,2,154,232,0,2,164,0,0,1,1,3,1 276 | 58,0,4,130,197,0,0,131,0,0.6,2,0,3,0 277 | 57,1,4,110,335,0,0,143,1,3,2,1,7,2 278 | 47,1,3,130,253,0,0,179,0,0,1,0,3,0 279 | 55,0,4,128,205,0,1,130,1,2,2,1,7,3 280 | 35,1,2,122,192,0,0,174,0,0,1,0,3,0 281 | 61,1,4,148,203,0,0,161,0,0,1,1,7,2 282 | 58,1,4,114,318,0,1,140,0,4.4,3,3,6,4 283 | 58,0,4,170,225,1,2,146,1,2.8,2,2,6,2 284 | 56,1,2,130,221,0,2,163,0,0,1,0,7,0 285 | 56,1,2,120,240,0,0,169,0,0,3,0,3,0 286 | 67,1,3,152,212,0,2,150,0,0.8,2,0,7,1 287 | 55,0,2,132,342,0,0,166,0,1.2,1,0,3,0 288 | 44,1,4,120,169,0,0,144,1,2.8,3,0,6,2 289 | 63,1,4,140,187,0,2,144,1,4,1,2,7,2 290 | 63,0,4,124,197,0,0,136,1,0,2,0,3,1 291 | 41,1,2,120,157,0,0,182,0,0,1,0,3,0 292 | 59,1,4,164,176,1,2,90,0,1,2,2,6,3 293 | 57,0,4,140,241,0,0,123,1,0.2,2,0,7,1 294 | 45,1,1,110,264,0,0,132,0,1.2,2,0,7,1 295 | 68,1,4,144,193,1,0,141,0,3.4,2,2,7,2 296 | 57,1,4,130,131,0,0,115,1,1.2,2,1,7,3 297 | 57,0,2,130,236,0,2,174,0,0,2,1,3,1 298 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Heart-disease-prediction-system-in-python-using-Support-vector-machine-and-PCA 2 | Predicts the Probability of Heart Disease in a person given the patients' medical details . Dimensionality Reduction is performed using Principal Component Analysis and Classifier used is SVM and LinearSVC 3 | --------------------------------------------------------------------------------