Gutenberg - Nick Damiano

Training 4.75 seconds, 
Prediction: 5.08 seconds
Accuracy: 73%

My algorithm to identify the category for an unknown book is:

1) Count the occurrences of the words - similar to our win-loss prework exercise - and store it in a hash with word as key and frequency as value.
2) Sort the Hash by frequency and grab the top 100 most frequently occurring words - storing them into an 2-dimensional array. The array looks something like this [["nick", 10], ["is", 2], ["rad", 9]].
3) Run .map on that array - grabbing only the first of the inner array and store that in a variable so now we have an array of just the top 100 words. 
4)Repeat the above steps for each of the tokens passed in during the predictions. 
5)Subtract the token word list array from the known subject array and what we get is an array containing all of the words that didn't match between the two.
6)Find the number of elements, the smaller the number the more successful matches were made and the more likely the subject matched against is the correct subject. 
7) Test each differences array count against the existing smallest one. If the differences array element count is smaller, replace the variables storing the up-to-then most likely subject with the new subject, and the previous size of differences array with the new number of elements in differences array. 
8) Return the most-likely subject.