1
00:00:02,410 --> 00:00:09,040
This is what is known in software engineering as test driven development or TDD in test driven development.

2
00:00:09,040 --> 00:00:15,840
We start by running tests because number one your code should always have tests and number two running

3
00:00:15,850 --> 00:00:20,250
the test first forces you to think about how you expect your API to work.

4
00:00:20,440 --> 00:00:26,670
And it allows you to make sensible design decisions without being distracted by implementation details.

5
00:00:26,800 --> 00:00:31,330
So you see how this applies to every machine learning algorithm not just linear regression

6
00:00:35,700 --> 00:00:37,890
in a lot of my older coding videos.

7
00:00:37,890 --> 00:00:41,530
I unfortunately decided to just write the code straight through.

8
00:00:41,610 --> 00:00:44,850
This helped some people but is not ideal for others.

9
00:00:44,850 --> 00:00:48,610
In addition the coding videos will appear without warning.

10
00:00:48,660 --> 00:00:51,670
Generally the lecturers appear in the same pattern.

11
00:00:51,680 --> 00:00:54,930
First we do theory and then we do the corresponding code.

12
00:00:54,930 --> 00:00:56,700
It pretty much always works this way.

13
00:00:57,900 --> 00:01:02,910
So after the theory lecture you can be pretty sure we are going to implement that theory in code soon

14
00:01:03,330 --> 00:01:09,820
unless it's so simple that it can be an exercise now to avoid treating everyone like they're in kindergarten.

15
00:01:09,850 --> 00:01:15,970
I don't have videos telling you that it's time to code your proactive and independent adults.

16
00:01:15,970 --> 00:01:21,220
So when you learn some theory you already know that it's time to try to put that into code by yourself

17
00:01:25,630 --> 00:01:30,970
sometimes you might get stuck and have no idea what a writing code or what the data set is.

18
00:01:31,030 --> 00:01:36,070
In that case it's fine to watch the next coding lecture but don't watch it all the way through.

19
00:01:36,370 --> 00:01:41,440
Watch just enough so that you know what the general idea is and what we're trying to accomplish and

20
00:01:41,440 --> 00:01:48,020
then try to finish the rest yourself.

21
00:01:48,060 --> 00:01:52,950
Now let's say you've watched just enough so that you know we're trying to do you know the theory but

22
00:01:52,950 --> 00:01:54,900
you still can't complete the code.

23
00:01:55,260 --> 00:02:01,020
At this point you may want to revisit the lecture theory to make sure you really understood each part.

24
00:02:01,290 --> 00:02:05,940
Failing that you may want to try and get clarification on the discussion board.

25
00:02:05,940 --> 00:02:09,890
Failing that you may want to look at external resources as well.

26
00:02:10,050 --> 00:02:14,880
Sometimes you might be missing some important computer science background that I've assumed everyone

27
00:02:14,880 --> 00:02:16,270
already knows.

28
00:02:16,320 --> 00:02:19,440
That's perfectly fine because everyone has a different background.

29
00:02:20,220 --> 00:02:25,010
It's highly encouraged to do your own research and this is also perfectly normal.

30
00:02:25,020 --> 00:02:27,510
It's not a bad thing it's a good thing.

31
00:02:27,510 --> 00:02:32,990
Ask any university student if this is what they do and they'll tell you that they do it all the time.

32
00:02:33,000 --> 00:02:37,230
This builds a level of mental toughness and initiative taking that's important.

33
00:02:37,230 --> 00:02:42,620
If you want to learn this stuff there is a lot to learn and I myself am still learning new things every

34
00:02:42,620 --> 00:02:42,980
day.

35
00:02:46,430 --> 00:02:51,410
So let's say you've re watched the theory lecture you've looked at some external resources on the theory

36
00:02:51,770 --> 00:02:55,310
and you still don't understand how you would put it into code.

37
00:02:55,310 --> 00:02:58,560
Well at this point there are some great exercises you can do.

38
00:02:58,940 --> 00:03:04,280
Watch the coding lecture or look at the folklore on GitHub hub go through it and make sure you understand

39
00:03:04,280 --> 00:03:05,890
each line.

40
00:03:05,930 --> 00:03:10,900
The next step is without looking at the code again try to implement it yourself.

41
00:03:10,910 --> 00:03:13,430
This by itself is a great learning tool.

42
00:03:13,580 --> 00:03:18,710
Many of the algorithms I've learned I didn't understand them the first time I learned them by looking

43
00:03:18,710 --> 00:03:21,320
at someone else's implementation and dissecting it.

44
00:03:23,330 --> 00:03:29,200
I looked at each part and I asked myself which parts that I get right and which parts that I get wrong.

45
00:03:29,210 --> 00:03:32,180
This helps you understand the mistakes you were making previously

46
00:03:35,810 --> 00:03:39,240
the cool thing about implementation is it works backwards.

47
00:03:39,550 --> 00:03:43,360
We go from theory to code but thinking in the reverse direction.

48
00:03:43,520 --> 00:03:45,950
The code actually helps us understand the theory better.

49
00:03:45,950 --> 00:03:52,120
Also I always say that if you can't implement the code then you don't understand the theory.

50
00:03:52,190 --> 00:03:56,900
So if you can learn the theory 50 percent of the way try to implement the code.

51
00:03:56,900 --> 00:04:00,560
Look at an existing implementation and then finally get it working.

52
00:04:00,560 --> 00:04:05,540
Then you can be guaranteed that you now know more than just 50 percent of the theory.

53
00:04:05,540 --> 00:04:10,340
The act of coding helps you understand more of the theory than if you had just learned the theory by

54
00:04:10,340 --> 00:04:10,910
itself

55
00:04:14,190 --> 00:04:17,060
so implementation helps you understand the theory.

56
00:04:17,190 --> 00:04:20,670
But it also helps you understand the intuition as well.

57
00:04:20,670 --> 00:04:22,410
Intuition is a tricky thing.

58
00:04:22,440 --> 00:04:28,050
In fact I would go so far as to say it's a trap in many or maybe even most cases.

59
00:04:28,080 --> 00:04:34,050
Intuition is built on experience that means deriving the theory from first principles or in other words

60
00:04:34,050 --> 00:04:39,670
deriving the theory from facts you already know to be true and from implementation.

61
00:04:39,930 --> 00:04:45,420
Students often want to hear intuition from people with lots of experience but the problem is that this

62
00:04:45,420 --> 00:04:47,340
intuition is built on hindsight.

63
00:04:51,290 --> 00:04:57,600
Intuition is often both the first thing and the last thing you want to focus on you want to have a little

64
00:04:57,600 --> 00:05:03,530
bit of intuition at the beginning so you have some general idea of what you want to accomplish.

65
00:05:03,630 --> 00:05:08,940
Then after you learn the theory and implementation you can reflect on the details and summarize them

66
00:05:08,940 --> 00:05:10,340
at a high level.

67
00:05:10,350 --> 00:05:13,590
This is real intuition built on hindsight and experience

68
00:05:18,400 --> 00:05:23,680
the big mistake beginners make is that they read some intuition written by someone else who actually

69
00:05:23,680 --> 00:05:27,090
has experience when they themselves do not.

70
00:05:27,130 --> 00:05:30,750
From an outsider's perspective it's hard to tell the difference.

71
00:05:30,760 --> 00:05:37,040
Why is that one of the beginner can regurgitate the same high level ideas as the expert.

72
00:05:37,040 --> 00:05:41,310
Then it would sound like they are also an expert when in fact they are not.

73
00:05:41,370 --> 00:05:45,130
There are unfortunately too many courses out there that do this.

74
00:05:45,210 --> 00:05:49,950
They want you to feel good that you learn something and they want to avoid you having to do anything

75
00:05:49,950 --> 00:05:54,670
too difficult and because you can repeat the same high level intuitions.

76
00:05:54,680 --> 00:05:56,530
It actually sounds like you're an expert.

77
00:05:57,170 --> 00:05:58,920
So this is why I call it a trap.

78
00:06:03,410 --> 00:06:07,090
Knowing intuition not only makes you feel like you know something.

79
00:06:07,130 --> 00:06:13,100
It also makes you really confident about this fact and then because your ego wants to maintain this

80
00:06:13,100 --> 00:06:18,560
confidence you'll start making crazy statements like the theory and implementation are not important

81
00:06:18,980 --> 00:06:21,800
because you already understand the intuition.

82
00:06:21,800 --> 00:06:24,140
But as you know this is completely backwards

83
00:06:28,240 --> 00:06:33,070
let's summarize this lecture since that was a lot of information to take in.

84
00:06:33,100 --> 00:06:37,480
Remember this lecture is all about how and why you should code by yourself.

85
00:06:37,480 --> 00:06:43,270
First we talked about why this is because it ensures you are thinking about the details and filling

86
00:06:43,270 --> 00:06:46,740
in the blanks using your own pattern recognition skills.

87
00:06:46,780 --> 00:06:52,200
It ensures you don't just assume you know what's going on but that you actually know what's going on.

88
00:06:52,250 --> 00:06:58,110
There is a big difference especially if you're the type of person that likes to assume you know everything.

89
00:06:58,160 --> 00:07:04,070
Next we talked about how we talked about how all data is the same and it doesn't really matter what

90
00:07:04,070 --> 00:07:09,000
domain or industry your data is from the same algorithms all apply.

91
00:07:09,020 --> 00:07:14,620
Next we looked at the interfaces to the algorithms which are also conveniently all the same.

92
00:07:14,840 --> 00:07:20,780
So we have a kind of mix and match type of scenario where we can input any kind of data into any kind

93
00:07:20,780 --> 00:07:22,170
of model.

94
00:07:22,190 --> 00:07:28,010
For example you can use linear regression with financial data or you can use a neural network on ecological

95
00:07:28,010 --> 00:07:29,000
data.

96
00:07:29,000 --> 00:07:32,650
All data is the same in all models have the same interface.

97
00:07:36,410 --> 00:07:40,760
Next we talked about a strategy for how to actually apply this.

98
00:07:40,760 --> 00:07:45,210
You've probably already seen that we always alternate between theory and code.

99
00:07:45,290 --> 00:07:49,520
First we discuss the theory and then we implement that in code.

100
00:07:49,520 --> 00:07:54,380
Sometimes you might have to go back and revisit the theory or sometimes you might have to look things

101
00:07:54,380 --> 00:07:55,640
up on the Internet.

102
00:07:55,670 --> 00:07:57,920
That's perfectly normal.

103
00:07:57,930 --> 00:08:01,600
This is pretty much the day in the life of a university student.

104
00:08:01,770 --> 00:08:07,020
We're trying to build the same level of mental toughness and initiative taking in this course.

105
00:08:07,020 --> 00:08:08,990
So the strategy is stop.

106
00:08:09,030 --> 00:08:15,390
After you learn the theory and try to code yourself sometimes you need a little more detail so you might

107
00:08:15,390 --> 00:08:20,100
want to watch a little bit of the coding lectures to see what's going on and then try to implement the

108
00:08:20,100 --> 00:08:21,780
rest yourself.

109
00:08:21,780 --> 00:08:27,050
If you can't get it by yourself then maybe try watching the whole thing or looking at the expected result

110
00:08:27,420 --> 00:08:30,180
and then trying to implement it from memory.

111
00:08:30,180 --> 00:08:35,040
This by itself is a great learning tool because it allows you to ask yourself what did I get right and

112
00:08:35,040 --> 00:08:38,430
what did I get wrong so you can understand the mistakes you were making

113
00:08:42,850 --> 00:08:43,670
finally.

114
00:08:43,720 --> 00:08:49,210
It's important to understand the difference between intuition theory and implementation and how they

115
00:08:49,210 --> 00:08:51,110
reinforce each other.

116
00:08:51,160 --> 00:08:56,740
It's important to not fall into the trap of only understanding intuition written by someone else and

117
00:08:56,740 --> 00:09:00,980
then assuming that this equates to actually understanding everything.

118
00:09:01,120 --> 00:09:06,640
In many cases it's not about waiting for someone to tell you some nice phrases that trick you into thinking

119
00:09:06,640 --> 00:09:12,310
you understand the intuition but rather you should seek intuition by working through the theory and

120
00:09:12,310 --> 00:09:13,990
the implementation.

121
00:09:13,990 --> 00:09:18,040
And lastly don't forget when it's time to code you must code.
