The data is split into two matrices trainPatient and testPatient Each row of

# The data is split into two matrices trainpatient and

• Homework Help
• 3

This preview shows page 3 out of 3 pages.

completely random sample of the population) who may or may not have heart disease. The data is split into two matrices, trainPatient and testPatient . Each row of these three-column matrices represents a patient. The first column contains the age of the patient in 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 they have heart disease, again with “1” indicating yes and “0” no. trainPatient will be used to “train” your classifier by estimating various probabilities. testPatient will be used to evaluate classifier performance, but not to estimate probabilities. To define a probabilistic model of this data, we let Y i = D if patient i has heart disease, and Y i = H if patient i does not. To construct a simple Bayesian classifier, we will compute the posterior probability P ( Y i | X i ) of the class label given some feature X i . If P ( Y i = D | X i ) > P ( Y i = H | X i ), we classify patient i as probably having heart disease. Otherwise, we classify them as probably not having heart disease. By Bayes’ rule, the posterior probability P ( Y i | X i ) = P ( X i | Y i ) P ( Y i ) P ( X i ) . Consider the feature X i = A i , where A i = 1 if patient i has age > 55, and A i = 0 if patient i has age 55. a) We estimate probabilities by counting event frequencies in the training data. Let N be the total number of patients, N D the number of patients with heart disease, N DA the number of patients with heart disease over age 55, N H the number of patients without heart disease, and N HA the number of patients without heart disease over age 55. We set P ( Y i = D ) = N D N , P ( Y i = H ) = N H N , P ( X i = 1 | Y i = D ) = N DA N D , P ( X i
• Fall '08
• Smyth,P
• Normal Distribution, Probability theory, probability density function, Yi, Cumulative distribution function

### What students are saying

• 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.

Kiran 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.

Dana 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.

Jill 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 )
Answers in as fast as 15 minutes