1
00:00:00,900 --> 00:00:01,780
Right.

2
00:00:01,800 --> 00:00:02,370
Welcome back.

3
00:00:02,610 --> 00:00:04,110
So this might I do.

4
00:00:04,380 --> 00:00:07,140
I'm going to create a new script so I'll come to follow over here.

5
00:00:07,140 --> 00:00:10,590
New and then I'm going to press control.

6
00:00:10,610 --> 00:00:11,440
Yes.

7
00:00:11,650 --> 00:00:13,940
And I'm going to navigate.

8
00:00:14,290 --> 00:00:20,110
I'm going to navigate to uh um my project folder is cut or not over here.

9
00:00:20,290 --> 00:00:23,020
I'm going to call this helper.

10
00:00:23,290 --> 00:00:28,540
There's going to be the name of the script and I'm going to write a function in this script to help

11
00:00:28,540 --> 00:00:29,840
us load a war.

12
00:00:30,310 --> 00:00:32,230
What data what in your network.

13
00:00:32,230 --> 00:00:36,910
I'll start off by importing num pi import num pi

14
00:00:40,500 --> 00:00:41,450
S and P.

15
00:00:41,570 --> 00:00:42,260
Like this.

16
00:00:42,410 --> 00:00:47,290
Once that is done I'm going to import H5 pi.

17
00:00:47,840 --> 00:00:51,940
Remember there's the format of what image data once that's done.

18
00:00:51,950 --> 00:00:53,590
I'm going to write my function I'll say it.

19
00:00:53,600 --> 00:01:02,780
Def load data set and then come here like this.

20
00:01:03,240 --> 00:01:03,530
Okay.

21
00:01:03,550 --> 00:01:05,900
I'm gonna create a variable quote train data set.

22
00:01:05,900 --> 00:01:08,100
We're gonna have train and test data set.

23
00:01:08,330 --> 00:01:14,000
We're going to have the training set is going to have its x values its y values to test set is going

24
00:01:14,000 --> 00:01:15,090
to have the same thing.

25
00:01:15,220 --> 00:01:16,520
I'll say train data set

26
00:01:19,990 --> 00:01:22,990
and all we have to do is read I far so see

27
00:01:27,690 --> 00:01:34,850
H5 pi data file and then we find a file in our food our code data set

28
00:01:37,650 --> 00:01:42,460
in the name of the file this is trained you makes data Delta H5

29
00:01:45,710 --> 00:01:49,150
and we said we are reading it.

30
00:01:49,190 --> 00:01:53,600
So we pass are over here like this.

31
00:01:53,600 --> 00:01:54,050
Okay.

32
00:01:54,110 --> 00:02:01,590
So once we've read a file we are going to take the x values and story tonight a separate variable and

33
00:02:01,590 --> 00:02:12,920
a wife I'll use in a separate variable to do it I'm gonna see cranes set X original because then I'll

34
00:02:12,920 --> 00:02:21,530
see an umpire ray which we've renamed to NDP num pi dot array and then obviously train data which is

35
00:02:21,530 --> 00:02:23,090
this variable we've created here

36
00:02:27,160 --> 00:02:28,590
what I want to do is say

37
00:02:33,260 --> 00:02:44,390
Crane sets X and then there's the first index and then the second one we see the semicolon for all right

38
00:02:44,750 --> 00:02:50,810
what is this going to do is this is going to get the features this is gonna get a features of the training

39
00:02:50,820 --> 00:03:00,740
sets which are the x values and then I'm gonna do for the y values as well as a train set y or rage

40
00:03:01,120 --> 00:03:06,260
I'm going to straighten this variable and then we'll see and Peter s a ray

41
00:03:09,980 --> 00:03:10,790
Crane set

42
00:03:17,380 --> 00:03:27,130
and then when a pass Crane set y I'm typing this because this the way I want H5 data is arranged internally

43
00:03:28,260 --> 00:03:30,000
right.

44
00:03:30,250 --> 00:03:30,660
Right.

45
00:03:30,730 --> 00:03:33,580
So what we've just done is for Crane data set.

46
00:03:33,580 --> 00:03:35,300
This is for the training set.

47
00:03:35,410 --> 00:03:42,850
Next we going to take the test set and put it into it's X and then it's y.

48
00:03:43,990 --> 00:03:55,900
So I'm gonna come down here and see test data set because each 5 pi that's fine and is the same file

49
00:03:58,690 --> 00:04:05,110
is not the same file that we have quite different file for test of course we'll see a data sets

50
00:04:07,780 --> 00:04:23,740
slash test AMG data that H5 then a POS are here for read once that is done I'm going to see test set

51
00:04:25,620 --> 00:04:26,410
next original

52
00:04:30,540 --> 00:04:33,460
and I'm simply going to copy what I have here and rename it

53
00:04:38,570 --> 00:04:41,150
this over here becomes test set.

54
00:04:46,210 --> 00:04:48,040
This becomes test as well.

55
00:04:53,510 --> 00:04:56,420
Then I'm going to do for why put this

56
00:05:02,480 --> 00:05:03,530
this becomes test

57
00:05:06,270 --> 00:05:07,370
this becomes test.

58
00:05:09,570 --> 00:05:10,840
This becomes test as well.

59
00:05:12,720 --> 00:05:19,010
So once this is done we going to grab a list of classes and storage in a variable called classes.

60
00:05:19,030 --> 00:05:27,570
Come over here C classes equals empty array and then I'm gonna say

61
00:05:30,600 --> 00:05:31,620
test data set

62
00:05:36,030 --> 00:05:39,480
and then list classes

63
00:05:45,390 --> 00:05:45,750
right.

64
00:05:45,750 --> 00:05:47,980
I'm gonna grab all storage and classes.

65
00:05:48,000 --> 00:05:48,400
Okay.

66
00:05:48,420 --> 00:05:49,260
We're almost done.

67
00:05:49,260 --> 00:05:57,300
What we have to do now is simply reshape the DIY set for the training set and the test set.

68
00:05:57,330 --> 00:06:01,650
So I'm gonna come here and see cranes set.

69
00:06:02,460 --> 00:06:07,410
Y RH which is the original y set.

70
00:06:07,430 --> 00:06:22,980
I see a train set y original to reshape and then what I want to do is one by and I'm going to grab the

71
00:06:24,750 --> 00:06:25,680
one I grew up this

72
00:06:30,040 --> 00:06:41,520
dot shape index 0 right and I'm going to do the same for the test set.

73
00:06:42,150 --> 00:06:46,260
Come over here and then this becomes test

74
00:06:49,960 --> 00:06:51,030
just becomes test

75
00:06:55,700 --> 00:06:59,540
this becomes test right.

76
00:06:59,550 --> 00:07:07,080
Once this is done we can complete our function by returning the data we've processed or return to the

77
00:07:07,200 --> 00:07:17,620
sets we have processed and rearranged so I'll say return over here we can return train set X or rage

78
00:07:19,770 --> 00:07:26,220
and then we can return train set y or regional.

79
00:07:26,700 --> 00:07:35,610
So break and then test set X brake.

80
00:07:39,100 --> 00:07:41,330
I forgot the word set over here

81
00:07:44,300 --> 00:07:50,050
and then test set y a rake.

82
00:07:51,360 --> 00:07:53,330
Um we have the last one.

83
00:07:53,370 --> 00:08:01,090
Classes over here we can return to as well put over here to return.

84
00:08:01,940 --> 00:08:02,380
Right.

85
00:08:02,390 --> 00:08:03,770
So there is going to be a Y.

86
00:08:03,770 --> 00:08:08,540
Help File we shall be adding new functions to this as we go through the course.

87
00:08:09,080 --> 00:08:12,110
So now um we are done with this function.

88
00:08:12,110 --> 00:08:18,670
We shall use this function in a 1 your network script um and we cannot test it now.

89
00:08:18,710 --> 00:08:23,610
We test it when we load it during the um the neural network scripting.

90
00:08:24,080 --> 00:08:25,730
So if you have any questions just let me know.

91
00:08:25,760 --> 00:08:28,350
But for now this all there is for this particular lesson.

92
00:08:28,370 --> 00:08:29,090
I'll see you later.
