diff --git a/bayes.py b/bayes.py index 272e974a43b319c122ab9b7b37ea376e3cc72961..6752762a29570ddde18a88d10df40304a3a6c5ce 100644 --- a/bayes.py +++ b/bayes.py @@ -34,9 +34,9 @@ def train(dataset): """ TODO - Implement the following functions. In each of these functions, you can use the MODEL variable which is a dictionary which has three members: - MODEL['count_of_word_by_outcome'][outcome][word] = count_of_word_in_all_documents - MODEL['num_data_points'] = number_of_documents_in_the_dataset - MODEL['count_of_data_points_with_outcome'][outcome] = number_of_documents_in_the_data_set_which_have_the_correct_outcome_as_outcome + MODEL['count_of_word_by_outcome'][outcome][word] = Total number of documents in the category 'outcome' in which this word appears + MODEL['num_data_points'] = Total number of documents in the data set + MODEL['count_of_data_points_with_outcome'][outcome] = Total number of documents in the category 'outcome' """ @cache def pr_outcome(outcome : str) : # Pr(outcome)