Question: To start, implement the `update_model` function in the [Naive Bayes Block](#Naive-Bayes-Block). Make sure to read the function comments so you know what to update. Also
To start, implement the `update_model` function in the [Naive Bayes Block](#Naive-Bayes-Block). Make sure to read the function comments so you know what to update. Also review the `NaiveBayes` class variables in the `def __init__` method of the `NaiveBayes class` to get a sense of which statistics are important to keep track of. Once you have implemented `update_model`, run the train model function using the code below. nb = NaiveBayes(PATH_TO_DATA, tokenizer=tokenize_doc) nb.train_model() if len(nb.vocab) == 251637: print ("Great! The vocabulary size is {}".format(251637)) else: print ("Oh no! Something seems off. Double check your code before continuing. Maybe a mistake in update_model?")
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
