[5 P]Implement an algorithm for learning a naive Bayes classifier and apply it to a spam email data set. You are required to use MATLAB for this assignment. The spam dataset is available for download on the course homepage5.
Write a function called nbayes_learn.m that takes a training dataset for a binary classification task with binary attributes and returns the posterior Beta distributions of all model parameters (specified by variables and for the th model parameter) of a naive Bayes classifier given a prior Beta distribution for each of the model parameters (specified by variables and for the th model parameter).
Write a function called nbayes_predict.m that takes a set of test data vectors and returns the most likely class label predictions for each input vector based on the posterior parameter distributions obtained in a).
Use both functions to conduct the following experiment. For your assignment you will be working with a data set that was created a few years ago at the Hewlett Packard Research Labs as a testbed data set to test different spam email classification algorithms.
Present your results clearly, structured and legible. Document them in such a way that anybody can reproduce them effortless. Send the code of your solution to mailto:email@example.com@igi.tugraz.at