completely random sample of the population) who may or may not have heart disease.The data is split into two matrices,trainPatientandtestPatient. Each row of thesethree-column matrices represents a patient. The first column contains the age of the patientin years. The second indicates whether exercise causes them to experience chest pain, with“1” indicating yes and “0” no.The third column is the ground truth of whether theyhave heart disease, again with “1” indicating yes and “0” no.trainPatientwill be usedto “train” your classifier by estimating various probabilities.testPatientwill be used toevaluate classifier performance, butnotto estimate probabilities.To define a probabilistic model of this data, we letYi=Dif patientihas heart disease,andYi=Hif patientidoes not. To construct a simple Bayesian classifier, we will computethe posterior probabilityP(Yi|Xi) of the class label given some featureXi. IfP(Yi=D|Xi)> P(Yi=H|Xi), we classify patientias probably having heart disease. Otherwise, weclassify them as probably not having heart disease.By Bayes’ rule, the posterior probabilityP(Yi|Xi) =P(Xi|Yi)P(Yi)P(Xi). Consider the featureXi=Ai, whereAi= 1 if patientihas age>55, andAi= 0 if patientihas age≤55.a)We estimate probabilities by counting event frequencies in the training data. LetNbe thetotal number of patients,NDthe number of patients with heart disease,NDAthe number ofpatients with heart disease over age 55,NHthe number of patients without heart disease,andNHAthe number of patients without heart disease over age 55. We setP(Yi=D) =NDN,P(Yi=H) =NHN,P(Xi= 1|Yi=D) =NDAND,P(Xi
As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.
Temple University Fox School of Business ‘17, Course Hero Intern
I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.
University of Pennsylvania ‘17, Course Hero Intern
The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.
Tulane University ‘16, Course Hero Intern
Ask Expert Tutors
You can ask 0 bonus questions
You can ask 0 questions (0 expire soon)
You can ask 0 questions
(will expire )