In this lesson we're going to set up our notebook and get the data in your projects folder.
Open a new Python 3 notebook and name this notebook.
Eleven neural networks hyphen TAF handwriting recognition.
Then insert some markdown cells.
The first one I'll call imports and the second one I'll call Constance and the third one I'm going to
call get the data in terms of the inputs.
Once again we're gonna be working with a little bit of randomization.
So if you want to have the same starting point as me you can enter four lines of code at the very top
from num pint up random import seed and set the seed here to 8 8 8 and then from tensor flow import
set random underscore seed then we're going to call set random seed and supply another lucky number
as before.
Try 4 0 4.
All right.
These are the inputs that we need.
Now you're gonna get an error if you haven't installed tensor flow locally.
So check the previous tutorial with these set of instructions for them.
And otherwise we're gonna import our same old friends as before the operating system.
Import os num py important num pi as P.
And of course we're gonna need tensor flow right.
So import tensor flow as T F.
The next thing I'd like you to ask you to do is could the course resources page and download the data
set for this module.
Once your download has completed you should find this zip file here in your Downloads folder and honest
on a score data dump zip extract the contents of the zip file and you'll find a folder with five items
in it that data for testing are features for training our labels for testing our labels for training
and a little test image here.
Number two tiny number two.
What I'd like you to do is to add these files to your projects folder in our projects folder.
Would it create a new folder here and we're going to rename this folder here to read just amnesty in
all caps.
Once we've created this folder we can go inside of it and we're going to see upload and when I select
all the CSP files and the little test on underscore score image stop PMG so click open.
And at this point it might give us a file size warning because it's a large amount of data and it's
all stored in C as V files.
We're just going to confirm that we want to upload it now we'll just hit upload upload upload upload.
This one's taking a little bit longer.
Just upload this thing this time it's giving me a percentage progress which is nice by the way.
You don't have to go through this.
Do we hear from Jupiter to do the upload.
It might actually just be easier to drag and drop this into the amnesty folder on your hard drive.
Just take all of these and you can copy them into the endless folder that you created under your project
folder.
Now that we've successfully added all the data to the project folder we can go back into our Jupiter
notebook and we can take the data that's currently in the C as V's and create a name pie array from
them.
The first thing I'll do is I'll create some constants for the relative paths to these files so see X
on a school train on the score path is equal to single quotes and this forward slash digit underscore
X train dot c s Ft.
And this is the folder in the same directory as my notebook and then inside amnesty.
I've got the digit on a school train don't CSP file so I'll just take this line.
I'll copy it a couple more times and just change the names of the constants and the relative paths as
you see here.
So we've got X underscored test on the score path y underscore train underscore path and so on.
The important thing is that the relative paths and the file names match up exactly.
If you've got a typo anywhere here then you're going to have problems down the road.
So just double check that this deed matches up now that I've got my path all set going to head shift
and turn on the cell and then down here in my next subsection where it says get to data.
I'm going to load all of these using num pi so check it out I'll add a little bit of micro benchmarking
code.
Percent percent time and I'll load my labels first.
So why on a school train underscore all shall hold on to all my training labels and I'm going to get
hold of all of these using num PIs load ti 60 functions so end p dot load t t y on a school train on
a score path.
So my T C function knows where to look for this year's v file CSB of course stands for comma separated
values so that the limiter in this case is going to be a comma and so provide that as well the limiter
equals single quotes comma and finally all my training and all my testing data is actually made up of
integers so we'll see this in a minute but I want to add another argument here.
D type is equal to int for integer so let's load this and as you can see the training data loads very
very quickly so why on the school train and a score all that shape is a flat num pi array with sixty
thousand values.
Now let's do the same for y on a score test.
So our testing data x plus tackle our features.
This is the big one.
Right.
X on the score train on the score.
All it's gonna be equal to end p dot load t x t parentheses x and it's got train on the score path the
limiter Como t type equals int and I'll tell you what I mean and a little bit of micro benchmarking
code him once again.
Percent percent time said you can see that this one is the big file and it's gonna take a little longer
to load slide shift enter on the cell hand while it's doing that I'm already gonna get started on X
on a score test that computer's still working so huge file I've actually given you him.
There we go.
It took a full minute on my machine to load in comparison our testing data should be a lot quicker and
indeed it only takes about 10 seconds.
Alright.
So now we've loaded all our data into num pi arrays but we haven't really taken a look at it yet.
We don't really know what we're dealing with.
So let's explore the data in the next lesson.