Hello.
Welcome back.
So let's stop building our neural network.
I'm going to create a new script here.
New file.
I'm going to do.
Control as to save.
And then I'm going to save this in DRM in our folder for the for this lesson which is cut or not.
I'm going to call this
cut and simply call this a cut in.
Yeah right.
So we have this.
Okay.
So where are we going to do this.
We start off by importing some of the packages we installed including our own package which is the m
the helper.
That's pi script we wrote earlier.
So I'll start off by importing some PI or say import num pay us NDP and then I'm going to import the
H5 pi import H5.
By this the format for our data I'm going to import CI pi import CI pi.
I'm going to import pi plots from math plot lib.
We'll use that for plotting.
So C import much plot lib.
What s pi plot SPL T.
Once that is done I'm going to import CI Pi which will need us for some of the image processing and
view in the image.
Other things with regards to image will find good functions in sci fi that we can use.
I'll see from sci fi import and what we need is the anti image.
And then once that's done I'm going to see from Help I remember our script that we created earlier.
It's called helper.
There is the name of the script so I'll say from helper
import and the function we want is load data set which is the only function that we have there.
Right.
Okay I'm going to run this to make sure all the inputs are available or click over here.
Run run show.
Let's see.
I'm sorry bother.
Click over here run run module.
Okay.
Invalid syntax.
What do we have.
Okay.
This should be from sidebar import.
Sorry about the run module
helper it says cannot import named load data set.
Okay let's see.
Let's verify the name of our function.
This is helper.
I'm going to open this in.
I do
okay.
I give the function the name load underscore.
Load set.
I'll call it load data set here.
Controls to save and I'll close this and then I run this again.
Sorry but a run module.
Okay.
So everything has been imported successfully.
Okay now now we can take a look at the content of our data.
We can view the image the images we have.
I start off by loading D.M. I'm going to call our function.
Our function is called the load data.
And this function returns it returns five variables we return to the training set Excel regional training
set while original test sets Excel regional tests at Y original and classes.
So I'm going to say I'm going to create these new variables called train set
X original and then
create a set y original and then test set X original
then test set
y
yeah we have training set X original 20 set to set.
Okay to set y original and then come up we have another one core classes and then I'm going to say equal
to then I'll call our function load data set.
Actually I'm going to.
So for those of you who are not very very much familiar with Python by listing all of this and put into
E cosine here and then our function the function return values will be stored in these variables accordingly
in the order in which we return the values.
Right we're going to process this again the training set XOR original we're going to process it.
That's why I'm calling this variable original but we might not need to process the test set.
So I'm going to take out the original name from it like this right.
So after executing this we would have loaded our data into these are these respective variables and
then once that's done we can actually view an image I can say P L T dot c image show I am sure.
And then what I want to do is say I'll go Crane set X original and then let's say I'm going to pass.
Index number 1 Let's see what is that index number 1 0 2 P L T dot show over here.
Right.
Control s to save then I click over here.
Run module and this is where we have an index number one.
OK.
This looks like a street.
Let's check another one.
I'll see index number two
okay.
We have a cut here right.
Let's we can verify it.
What a label says when a creative uh verbal here quote.
I say I E course
I say I.
Of course to say that I can simply pass I hear and I'm going to print I as well so I can come over here
say print
I'll say print y value is and then over here you can simply see the screen and then what I want to see
is a train set y and then what I'll do is some call on and then I'll pass I hear like this.
Okay.
Let's see.
So it's going to show that image and print it correspond in label.
And remember when it's one it means it's a cut one is zero.
It means it's not a cut.
So when we're check in is basically cut or not cut.
Later on we shall look at the d d for 410 data sets which allows us to classify over 10 different objects.
We will see that later about this one here is like a binary classifier.
It's either cut or not a cut.
Right.
So I'm going to run the module okay.
So as you can see you a cut here says what does it say.
Train set y on identified.
Let's see.
We have train set
cranes set underscore why I didn't write
okay so when I renamed this I wanted to take the word original off the Y the Y set and keep it only
by the exit cause the Y set we wouldn't pre process them or Yeah we wouldn't change it too much we're
going to pass this through a different a different line of code and then come out with a final exit.
That is why this has a rake.
Yeah in a way a fix this the C and I'm going to I'm going to make sure I'm gonna make sure I sort of
print this before I view the image otherwise we would have to close the image before we see this printed
control s to save Click here to run module.
Okay.
And I can see it says Y value is 1 meaning it it's a cut.
Okay let's select another index I'll go back I'll go back to index number 1 control is to save click
here to run and click here to run.
Okay.
It says Y value is 0 and we know this is not a cut hence it is zero.
Okay.
Right now we've seen our.
Now we've seen that um we've got our image we've seen what exists in the dots H5 pi file once that is
done we can inspect the inspect the dimensions of our of our data sets in our test sets we yeah we inspect
the dimensions of our data sets which includes the training set and the test set we would do that India
in the next lesson.