1
00:00:00,690 --> 00:00:01,020
Hello.

2
00:00:01,050 --> 00:00:01,590
Welcome back.

3
00:00:01,890 --> 00:00:04,500
So let's stop building our neural network.

4
00:00:04,500 --> 00:00:06,240
I'm going to create a new script here.

5
00:00:06,270 --> 00:00:06,890
New file.

6
00:00:07,500 --> 00:00:07,980
I'm going to do.

7
00:00:07,990 --> 00:00:09,730
Control as to save.

8
00:00:09,990 --> 00:00:21,430
And then I'm going to save this in DRM in our folder for the for this lesson which is cut or not.

9
00:00:21,450 --> 00:00:22,620
I'm going to call this

10
00:00:27,240 --> 00:00:31,630
cut and simply call this a cut in.

11
00:00:31,640 --> 00:00:33,080
Yeah right.

12
00:00:33,120 --> 00:00:33,990
So we have this.

13
00:00:34,550 --> 00:00:35,180
Okay.

14
00:00:35,340 --> 00:00:37,300
So where are we going to do this.

15
00:00:37,320 --> 00:00:43,910
We start off by importing some of the packages we installed including our own package which is the m

16
00:00:44,270 --> 00:00:45,360
the helper.

17
00:00:45,360 --> 00:00:48,000
That's pi script we wrote earlier.

18
00:00:48,030 --> 00:00:57,810
So I'll start off by importing some PI or say import num pay us NDP and then I'm going to import the

19
00:00:57,900 --> 00:01:02,000
H5 pi import H5.

20
00:01:02,010 --> 00:01:10,790
By this the format for our data I'm going to import CI pi import CI pi.

21
00:01:11,290 --> 00:01:15,210
I'm going to import pi plots from math plot lib.

22
00:01:15,220 --> 00:01:16,450
We'll use that for plotting.

23
00:01:16,830 --> 00:01:22,320
So C import much plot lib.

24
00:01:22,960 --> 00:01:30,210
What s pi plot SPL T.

25
00:01:31,300 --> 00:01:39,700
Once that is done I'm going to import CI Pi which will need us for some of the image processing and

26
00:01:39,940 --> 00:01:41,940
view in the image.

27
00:01:41,950 --> 00:01:46,480
Other things with regards to image will find good functions in sci fi that we can use.

28
00:01:46,480 --> 00:01:54,670
I'll see from sci fi import and what we need is the anti image.

29
00:01:55,480 --> 00:02:01,290
And then once that's done I'm going to see from Help I remember our script that we created earlier.

30
00:02:01,330 --> 00:02:02,990
It's called helper.

31
00:02:03,230 --> 00:02:06,670
There is the name of the script so I'll say from helper

32
00:02:09,340 --> 00:02:18,910
import and the function we want is load data set which is the only function that we have there.

33
00:02:18,940 --> 00:02:19,430
Right.

34
00:02:20,290 --> 00:02:27,310
Okay I'm going to run this to make sure all the inputs are available or click over here.

35
00:02:27,310 --> 00:02:29,650
Run run show.

36
00:02:29,670 --> 00:02:31,980
Let's see.

37
00:02:32,360 --> 00:02:33,660
I'm sorry bother.

38
00:02:34,060 --> 00:02:36,900
Click over here run run module.

39
00:02:38,800 --> 00:02:39,580
Okay.

40
00:02:39,580 --> 00:02:40,960
Invalid syntax.

41
00:02:41,020 --> 00:02:41,950
What do we have.

42
00:02:44,350 --> 00:02:44,850
Okay.

43
00:02:44,920 --> 00:02:46,960
This should be from sidebar import.

44
00:02:46,960 --> 00:02:50,470
Sorry about the run module

45
00:02:56,830 --> 00:03:01,440
helper it says cannot import named load data set.

46
00:03:01,450 --> 00:03:03,040
Okay let's see.

47
00:03:03,040 --> 00:03:04,750
Let's verify the name of our function.

48
00:03:04,750 --> 00:03:05,600
This is helper.

49
00:03:06,220 --> 00:03:07,860
I'm going to open this in.

50
00:03:07,900 --> 00:03:08,380
I do

51
00:03:12,660 --> 00:03:13,620
okay.

52
00:03:13,800 --> 00:03:16,080
I give the function the name load underscore.

53
00:03:16,080 --> 00:03:18,000
Load set.

54
00:03:18,060 --> 00:03:20,360
I'll call it load data set here.

55
00:03:20,470 --> 00:03:30,810
Controls to save and I'll close this and then I run this again.

56
00:03:34,470 --> 00:03:39,630
Sorry but a run module.

57
00:03:39,640 --> 00:03:40,030
Okay.

58
00:03:40,030 --> 00:03:42,820
So everything has been imported successfully.

59
00:03:43,150 --> 00:03:46,560
Okay now now we can take a look at the content of our data.

60
00:03:46,570 --> 00:03:50,360
We can view the image the images we have.

61
00:03:50,590 --> 00:03:55,960
I start off by loading D.M. I'm going to call our function.

62
00:03:55,960 --> 00:03:57,780
Our function is called the load data.

63
00:03:58,390 --> 00:04:05,530
And this function returns it returns five variables we return to the training set Excel regional training

64
00:04:05,530 --> 00:04:10,810
set while original test sets Excel regional tests at Y original and classes.

65
00:04:10,810 --> 00:04:15,730
So I'm going to say I'm going to create these new variables called train set

66
00:04:18,660 --> 00:04:20,700
X original and then

67
00:04:23,970 --> 00:04:30,750
create a set y original and then test set X original

68
00:04:33,450 --> 00:04:34,680
then test set

69
00:04:38,190 --> 00:04:38,580
y

70
00:04:44,570 --> 00:04:50,690
yeah we have training set X original 20 set to set.

71
00:04:50,690 --> 00:05:02,570
Okay to set y original and then come up we have another one core classes and then I'm going to say equal

72
00:05:02,570 --> 00:05:08,240
to then I'll call our function load data set.

73
00:05:08,460 --> 00:05:10,000
Actually I'm going to.

74
00:05:10,210 --> 00:05:20,150
So for those of you who are not very very much familiar with Python by listing all of this and put into

75
00:05:20,180 --> 00:05:27,410
E cosine here and then our function the function return values will be stored in these variables accordingly

76
00:05:27,830 --> 00:05:31,250
in the order in which we return the values.

77
00:05:31,260 --> 00:05:37,300
Right we're going to process this again the training set XOR original we're going to process it.

78
00:05:37,310 --> 00:05:43,560
That's why I'm calling this variable original but we might not need to process the test set.

79
00:05:43,580 --> 00:05:49,090
So I'm going to take out the original name from it like this right.

80
00:05:49,130 --> 00:05:56,630
So after executing this we would have loaded our data into these are these respective variables and

81
00:05:56,630 --> 00:06:05,480
then once that's done we can actually view an image I can say P L T dot c image show I am sure.

82
00:06:05,540 --> 00:06:17,870
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.

83
00:06:17,870 --> 00:06:25,400
Index number 1 Let's see what is that index number 1 0 2 P L T dot show over here.

84
00:06:25,910 --> 00:06:26,490
Right.

85
00:06:26,510 --> 00:06:30,340
Control s to save then I click over here.

86
00:06:30,350 --> 00:06:35,610
Run module and this is where we have an index number one.

87
00:06:35,940 --> 00:06:36,280
OK.

88
00:06:36,310 --> 00:06:38,870
This looks like a street.

89
00:06:38,890 --> 00:06:40,240
Let's check another one.

90
00:06:40,390 --> 00:06:41,830
I'll see index number two

91
00:06:48,260 --> 00:06:48,530
okay.

92
00:06:48,530 --> 00:06:50,950
We have a cut here right.

93
00:06:51,350 --> 00:06:52,700
Let's we can verify it.

94
00:06:52,760 --> 00:06:59,800
What a label says when a creative uh verbal here quote.

95
00:07:00,380 --> 00:07:02,120
I say I E course

96
00:07:05,040 --> 00:07:05,640
I say I.

97
00:07:05,660 --> 00:07:12,100
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

98
00:07:12,110 --> 00:07:12,980
say print

99
00:07:15,790 --> 00:07:28,570
I'll say print y value is and then over here you can simply see the screen and then what I want to see

100
00:07:28,570 --> 00:07:40,910
is a train set y and then what I'll do is some call on and then I'll pass I hear like this.

101
00:07:41,080 --> 00:07:41,790
Okay.

102
00:07:42,070 --> 00:07:42,400
Let's see.

103
00:07:42,400 --> 00:07:48,730
So it's going to show that image and print it correspond in label.

104
00:07:48,740 --> 00:07:53,560
And remember when it's one it means it's a cut one is zero.

105
00:07:53,560 --> 00:07:55,080
It means it's not a cut.

106
00:07:55,090 --> 00:07:59,110
So when we're check in is basically cut or not cut.

107
00:07:59,110 --> 00:08:07,550
Later on we shall look at the d d for 410 data sets which allows us to classify over 10 different objects.

108
00:08:07,550 --> 00:08:11,760
We will see that later about this one here is like a binary classifier.

109
00:08:11,810 --> 00:08:13,710
It's either cut or not a cut.

110
00:08:13,990 --> 00:08:14,750
Right.

111
00:08:14,770 --> 00:08:20,680
So I'm going to run the module okay.

112
00:08:21,220 --> 00:08:25,900
So as you can see you a cut here says what does it say.

113
00:08:25,930 --> 00:08:28,730
Train set y on identified.

114
00:08:28,770 --> 00:08:29,290
Let's see.

115
00:08:29,320 --> 00:08:30,400
We have train set

116
00:08:32,980 --> 00:08:35,620
cranes set underscore why I didn't write

117
00:08:38,730 --> 00:08:48,210
okay so when I renamed this I wanted to take the word original off the Y the Y set and keep it only

118
00:08:48,210 --> 00:08:56,220
by the exit cause the Y set we wouldn't pre process them or Yeah we wouldn't change it too much we're

119
00:08:56,220 --> 00:09:01,950
going to pass this through a different a different line of code and then come out with a final exit.

120
00:09:01,950 --> 00:09:04,020
That is why this has a rake.

121
00:09:04,030 --> 00:09:14,880
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

122
00:09:14,970 --> 00:09:19,870
print this before I view the image otherwise we would have to close the image before we see this printed

123
00:09:20,740 --> 00:09:25,730
control s to save Click here to run module.

124
00:09:26,220 --> 00:09:26,800
Okay.

125
00:09:26,820 --> 00:09:31,600
And I can see it says Y value is 1 meaning it it's a cut.

126
00:09:31,680 --> 00:09:38,310
Okay let's select another index I'll go back I'll go back to index number 1 control is to save click

127
00:09:38,330 --> 00:09:45,150
here to run and click here to run.

128
00:09:45,570 --> 00:09:46,400
Okay.

129
00:09:46,590 --> 00:09:51,430
It says Y value is 0 and we know this is not a cut hence it is zero.

130
00:09:51,480 --> 00:09:52,250
Okay.

131
00:09:52,350 --> 00:09:54,070
Right now we've seen our.

132
00:09:54,790 --> 00:10:03,600
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

133
00:10:03,600 --> 00:10:13,110
done we can inspect the inspect the dimensions of our of our data sets in our test sets we yeah we inspect

134
00:10:13,110 --> 00:10:20,560
the dimensions of our data sets which includes the training set and the test set we would do that India

135
00:10:20,630 --> 00:10:21,540
in the next lesson.
