Below is a code sample of a spam filter I wrote for my MAT345 course, Intro to Data Science. This sample shows a full process of parsing and cleaning data, training a machine learning algorithm, and testing the algorithm’s performance against a known data set. Throughout my implementation of the Naïve Bayes algorithm, I kept focus on utilizing the C++ STL to simplify the complexity, run-time, and readability of my code.