This is the Naive Bayes Classifier in Java (https://github.com/ChristianVersloot/Naive-Bayesian-Classifier) but then recoded into Python. Added as expansion onto the Java-based classifier: underflow protection using the summation of base-2 logarithms (as log(a*...*y*z) = log(a)+...+log(y)+log(z)) instead of multiplying the distinct probabilities.