mbah_bejo

Naive Bayes & K-Means Heart Disease

Sep 20th, 2021
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.94 KB | None | 0 0
  1. NAIVE BAYES
  2.  
  3.  
  4. === Run information ===
  5.  
  6. Scheme: weka.classifiers.bayes.NaiveBayes
  7. Relation: cleveland-14-heart-disease
  8. Instances: 303
  9. Attributes: 14
  10. age
  11. sex
  12. cp
  13. trestbps
  14. chol
  15. fbs
  16. restecg
  17. thalach
  18. exang
  19. oldpeak
  20. slope
  21. ca
  22. thal
  23. num
  24. Test mode: 10-fold cross-validation
  25.  
  26. === Classifier model (full training set) ===
  27.  
  28. Naive Bayes Classifier
  29.  
  30. Class
  31. Attribute <50 >50_1
  32. (0.54) (0.46)
  33. ============================================
  34. age
  35. mean 52.4655 56.6
  36. std. dev. 9.5284 7.9344
  37. weight sum 165 138
  38. precision 1.2 1.2
  39.  
  40. sex
  41. female 73.0 25.0
  42. male 94.0 115.0
  43. [total] 167.0 140.0
  44.  
  45. cp
  46. typ_angina 17.0 8.0
  47. asympt 40.0 105.0
  48. non_anginal 70.0 19.0
  49. atyp_angina 42.0 10.0
  50. [total] 169.0 142.0
  51.  
  52. trestbps
  53. mean 129.1273 134.3723
  54. std. dev. 16.0421 18.6815
  55. weight sum 165 138
  56. precision 2.2083 2.2083
  57.  
  58. chol
  59. mean 242.1789 251.1385
  60. std. dev. 53.384 49.3271
  61. weight sum 165 138
  62. precision 2.9007 2.9007
  63.  
  64. fbs
  65. t 24.0 23.0
  66. f 143.0 117.0
  67. [total] 167.0 140.0
  68.  
  69. restecg
  70. left_vent_hyper 69.0 80.0
  71. normal 97.0 57.0
  72. st_t_wave_abnormality 2.0 4.0
  73. [total] 168.0 141.0
  74.  
  75. thalach
  76. mean 158.4174 139.1005
  77. std. dev. 19.0916 22.5146
  78. weight sum 165 138
  79. precision 1.4556 1.4556
  80.  
  81. exang
  82. no 143.0 63.0
  83. yes 24.0 77.0
  84. [total] 167.0 140.0
  85.  
  86. oldpeak
  87. mean 0.5868 1.5932
  88. std. dev. 0.7744 1.2957
  89. weight sum 165 138
  90. precision 0.159 0.159
  91.  
  92. slope
  93. up 108.0 36.0
  94. flat 50.0 92.0
  95. down 10.0 13.0
  96. [total] 168.0 141.0
  97.  
  98. ca
  99. mean 0.2733 1.146
  100. std. dev. 0.6304 1.0148
  101. weight sum 161 137
  102. precision 1 1
  103.  
  104. thal
  105. fixed_defect 7.0 13.0
  106. normal 131.0 37.0
  107. reversable_defect 29.0 90.0
  108. [total] 167.0 140.0
  109.  
  110.  
  111.  
  112. Time taken to build model: 0 seconds
  113.  
  114. === Stratified cross-validation ===
  115. === Summary ===
  116.  
  117. Correctly Classified Instances 253 83.4983 %
  118. Incorrectly Classified Instances 50 16.5017 %
  119. Kappa statistic 0.6661
  120. Mean absolute error 0.1846
  121. Root mean squared error 0.3634
  122. Relative absolute error 37.2065 %
  123. Root relative squared error 72.9737 %
  124. Total Number of Instances 303
  125.  
  126. === Detailed Accuracy By Class ===
  127.  
  128. TP Rate FP Rate Precision Recall F-Measure MCC ROC Area PRC Area Class
  129. 0,867 0,203 0,836 0,867 0,851 0,667 0,904 0,918 <50
  130. 0,797 0,133 0,833 0,797 0,815 0,667 0,904 0,883 >50_1
  131. Weighted Avg. 0,835 0,171 0,835 0,835 0,835 0,667 0,904 0,902
  132.  
  133. === Confusion Matrix ===
  134.  
  135. a b <-- classified as
  136. 143 22 | a = <50
  137. 28 110 | b = >50_1
  138.  
  139. K-MEANS
  140.  
  141. === Run information ===
  142.  
  143. Scheme: weka.clusterers.SimpleKMeans -init 0 -max-candidates 100 -periodic-pruning 10000 -min-density 2.0 -t1 -1.25 -t2 -1.0 -N 2 -A "weka.core.EuclideanDistance -R first-last" -I 500 -num-slots 1 -S 10
  144. Relation: cleveland-14-heart-disease
  145. Instances: 303
  146. Attributes: 14
  147. age
  148. sex
  149. cp
  150. trestbps
  151. chol
  152. fbs
  153. restecg
  154. thalach
  155. exang
  156. oldpeak
  157. slope
  158. ca
  159. thal
  160. Ignored:
  161. num
  162. Test mode: Classes to clusters evaluation on training data
  163.  
  164. === Clustering model (full training set) ===
  165.  
  166.  
  167. kMeans
  168. ======
  169.  
  170. Number of iterations: 5
  171. Within cluster sum of squared errors: 648.4924706321818
  172.  
  173. Initial starting points (random):
  174.  
  175. Cluster 0: 65,female,non_anginal,140,417,t,left_vent_hyper,157,no,0.8,up,1,normal
  176. Cluster 1: 58,male,asympt,114,318,f,st_t_wave_abnormality,140,no,4.4,down,3,fixed_defect
  177.  
  178. Missing values globally replaced with mean/mode
  179.  
  180. Final cluster centroids:
  181. Cluster#
  182. Attribute Full Data 0 1
  183. (303.0) (169.0) (134.0)
  184. ==============================================================================
  185. age 54.3663 52.1006 57.2239
  186. sex male male male
  187. cp asympt non_anginal asympt
  188. trestbps 131.6238 129.497 134.306
  189. chol 246.264 240.4024 253.6567
  190. fbs f f f
  191. restecg normal normal left_vent_hyper
  192. thalach 149.6469 159.0828 137.7463
  193. exang no no yes
  194. oldpeak 1.0396 0.5805 1.6187
  195. slope up up flat
  196. ca 0.6745 0.4302 0.9826
  197. thal normal normal reversable_defect
  198.  
  199.  
  200.  
  201.  
  202. Time taken to build model (full training data) : 0.01 seconds
  203.  
  204. === Model and evaluation on training set ===
  205.  
  206. Clustered Instances
  207.  
  208. 0 169 ( 56%)
  209. 1 134 ( 44%)
  210.  
  211.  
  212. Class attribute: num
  213. Classes to Clusters:
  214.  
  215. 0 1 <-- assigned to cluster
  216. 138 27 | <50
  217. 31 107 | >50_1
  218.  
  219. Cluster 0 <-- <50
  220. Cluster 1 <-- >50_1
  221.  
  222. Incorrectly clustered instances : 58.0 19.1419 %
Add Comment
Please, Sign In to add comment