So I'd say we're pretty much done with training our base classifier.
Let's put our code for testing it and evaluating our algorithm into a separate notebook.
So come to my projects folder and create a new notebook and I will name this notebook.
0 7 B's classifier hyphen testing inference and Evaluation at the top.
Of course we'll add our notebook imports.
These are gonna be our usual suspects.
If you still have your training notebook open you can copy none pine pandas paste them in here and then
just add Matt.
Plot lib dot pi plot as BLT.
We're gonna be doing some graphing and visualization in this notebook so we're gonna need map plot lib
and Seabourn as S.A. because we've got map plot lib in here.
We'll add some Python notebook magic with scent not plot lib in line just below we'll add our constants
here right and grab some of the same file paths that we used in our training file.
I'll grab all our constants copy them and I'll paste them over.
The only thing I'll do is I'll delete the training unescorted data on a school file.
So our training data and our test data all we need in this notebook are our probabilities that we've
worked out for our tokens and our features and target for our test data set.
And these two we've prepared in the previous notebook and we've got them right here.
So let me hit shift enter on the cell and we're ready to load the data load the data.
There we go.
All our stuff is in text files so this should be fairly easy.
Our features will store in a variable called X test and this will be equal to NDP dot load t 60 parentheses
test feature matrix comma the limit to single quotes with a space.
Our target will be y at a school test and that will be NDP dot low to T.
You guessed it.
Test target file to limit a single quotes space.
Next one up.
Call this one token problem.
Bill at TS.
Need the probability that a token is spam.
So if we end p dot low T T token spam probability limit a space.
Copy this added two more times for the other two probability files the ham and the probability all on
the school tokens
these two of course will point to the other file paths home on a school probability on a score file
and took in all probability file.
There we go.
Just let me hit shift enter and that's it.
We're all set up and ready to go.
This is where the real work begins.
I'll see you in the next lesson.
Take care.