Build a joint probability table, like the ones we discussed in class notes, that represents the joint distribution over all varibles, i.e., P(Gender, Age, Class, Outcome). This table should have 32 entries because Gender ∈ {male, female}, Age ∈ {child, adult}, Class ∈ {1st, 2nd, 3d, crew}, and Outcome ∈ {death, survival}. You will use the data in this table for the following tasks. There is nothing to hand in for Task 0.
Build a probability table indicating P(death | Gender, Age, Class) for each combination of class, age, and gender. Display this table in the following way:
The rows of each table represent the different classes and the columns the different ages and genders. In each cell of the table, insert the conditional probability. Warning: Be alert to the possibility of a cell containing no data.
After you’ve built the probability table, make a second table, a classification table, which predicts death or survival for each feature combination. If P(death | Gender, Age, Class) > .5, then label that cell as death; otherwise label that cell as survival.
Build a Naive Bayes classifier. To build the classifier, you must first construct six one-dimensional tables: p(Class | death), p(Age | death), p(Gender | death), p(Class | survival), p(Age | survival), p(Gender | survival). To be clear on this notation, for p(Age | death), your table should have two rows, one for adult and one for child, and you should compute, for each age group, the probability of the deceased being in that age group. Also compute the unconditional probabilities, P(death) and P(survival), with P(death)+P(survival)=1. From this information, compute P(death | Gender, Age, Class) using the Naive Bayes assumption. In addition to the probability table, build the classification table as well.
The classification tables you built in Tasks 1 and 2 are not identical. Discuss the advantages/disadvantages of each table for making predictions in case of another disaster like the Titanic (assuming it occurred at the same time in history). Under what circumstances would you expect an empirical table to provide better predictions? Under what circumstances would you expect the naive Bayes table to provide better predictions?