1
00:00:02,200 --> 00:00:04,400
Everyone and welcome back to this class

2
00:00:07,750 --> 00:00:08,890
in this lecture.

3
00:00:08,890 --> 00:00:14,170
I'm going to go over a better way to install data science and machine learning libraries for Python.

4
00:00:14,170 --> 00:00:15,730
For Windows users.

5
00:00:16,090 --> 00:00:20,770
Historically Windows users have had a lot of problems installing this stuff.

6
00:00:20,770 --> 00:00:26,560
Luckily these days there is an option that makes things very painless and just as easy as they are on

7
00:00:26,560 --> 00:00:27,970
Linux or Mac.

8
00:00:27,970 --> 00:00:30,040
That is Anaconda.

9
00:00:30,040 --> 00:00:33,940
In fact even if you're not on windows you can still use Anaconda.

10
00:00:34,240 --> 00:00:38,890
It's nice because it isolates your environment from the defaults provided on your system.

11
00:00:38,890 --> 00:00:46,710
So for example you can have Python 3 and Anaconda but Python 2 as your system default when I first started

12
00:00:46,710 --> 00:00:52,200
these courses I wasn't keen on Windows since there were a few essential libraries that couldn't be installed

13
00:00:52,200 --> 00:00:59,120
on Windows without a significant amount of effort if at all in my view anything beyond a couple of lines

14
00:00:59,120 --> 00:01:02,060
in the console or clicking an install file is too much.

15
00:01:02,420 --> 00:01:04,850
And believe me some students even have trouble with that.

16
00:01:04,910 --> 00:01:11,210
So it's good not to make things too complicated before you can even begin the course nowadays that has

17
00:01:11,210 --> 00:01:12,440
changed.

18
00:01:12,440 --> 00:01:17,400
It's a lot easier to install things on Windows in large part thanks to Anaconda.

19
00:01:17,510 --> 00:01:21,740
And so this lecture is all about how to install all the data science and machine learning libraries

20
00:01:21,740 --> 00:01:25,590
you'll need on windows using Anaconda.

21
00:01:25,610 --> 00:01:30,830
So in this lecture I'm going to walk you through how to install Anaconda as well as some of the libraries

22
00:01:30,830 --> 00:01:36,670
you might need that don't already come with Anaconda you'll find that most of the common libraries such

23
00:01:36,670 --> 00:01:39,520
as Num pi and Saibai are already included.

24
00:01:39,520 --> 00:01:43,240
So if that's all you want to use then for you it's just a one click install

25
00:01:48,300 --> 00:01:49,040
on this slide.

26
00:01:49,050 --> 00:01:53,700
I'm going to give you a super short summarized version of this lecture so you don't have to walk through

27
00:01:53,700 --> 00:01:56,430
the installation with me if you don't want to.

28
00:01:56,460 --> 00:01:59,010
For some people that really helps since you can see it.

29
00:01:59,040 --> 00:02:00,630
But if you can do it on your own.

30
00:02:00,630 --> 00:02:07,190
Feel free so no one download and install Anaconda.

31
00:02:07,190 --> 00:02:13,400
This is just a one click install it already includes num pi zip by map plat lib and pandas.

32
00:02:13,400 --> 00:02:15,750
That's all we need for the numbers stack in Python.

33
00:02:15,770 --> 00:02:20,770
Linear regression and logistic regression and a few more courses.

34
00:02:20,870 --> 00:02:24,970
It also comes with NRT K which is what we use for MLP and psyche.

35
00:02:24,980 --> 00:02:32,150
Learn which has some pre-built machine learning models now even though this stuff comes by default you

36
00:02:32,150 --> 00:02:33,780
can still update them if you want.

37
00:02:33,860 --> 00:02:42,650
So you can do kinda update num pi for example and that will update num by number to install deep learning

38
00:02:42,650 --> 00:02:43,430
libraries.

39
00:02:43,460 --> 00:02:49,720
You've got pip install tensor flow that's going to install tensor flow and if you want to install cameras

40
00:02:49,750 --> 00:02:55,540
you have to first do kinda install Pip which is going to update Pip and then you can install cameras

41
00:02:55,570 --> 00:02:57,210
using pip install carrots.

42
00:02:57,760 --> 00:03:04,750
If you don't update Pip first you might get an error X. We have a S.A. A.K. which is Microsoft's Deep

43
00:03:04,750 --> 00:03:11,060
Learning library so you do pip install and then the S.A. K you Earl which you can get from Microsoft's

44
00:03:11,060 --> 00:03:11,600
website.

45
00:03:12,050 --> 00:03:17,390
So I'm not posting any you are all here because the version could likely change in the future and so

46
00:03:17,390 --> 00:03:24,380
you just google search how to install C A.K. and you can get a euro just like this.

47
00:03:24,470 --> 00:03:25,730
Next we have pi talk.

48
00:03:25,760 --> 00:03:32,990
That's pip install Minus C. Peter Gacy one two three pi torch after that we have a..

49
00:03:33,000 --> 00:03:40,410
So that's kinda installed V.A. or kind installed V.A. pie GP you if you have an end video GP you and

50
00:03:40,410 --> 00:03:42,570
you've installed the Cuda tool kit already

51
00:03:46,130 --> 00:03:52,550
number three install open a gym that's just pip installed gym if you want to be able to play Atari games

52
00:03:52,550 --> 00:03:54,490
also then that's more involved.

53
00:03:54,500 --> 00:04:00,960
So just skip to the end of this lecture where I walk you through that if you want to play and save videos

54
00:04:00,960 --> 00:04:04,890
using open AGM then you also have to install f f MPEG

55
00:04:10,270 --> 00:04:13,740
so the first thing we're gonna do is go over to the anaconda Web site.

56
00:04:13,750 --> 00:04:16,990
That's Anaconda dot com slash download.

57
00:04:16,990 --> 00:04:23,440
Scroll down to the window section and click on either Python three point six or Python two point seven.

58
00:04:23,440 --> 00:04:26,350
Or if you're watching this lecture in the future and there's a new version.

59
00:04:26,350 --> 00:04:32,110
Get that the code in my courses is compatible with both Python 2 and Python 3.

60
00:04:32,140 --> 00:04:36,370
So in that regard it doesn't really matter which one you get in the lectures.

61
00:04:36,370 --> 00:04:41,890
You might see Python to code but the best way to make sure you're seeing the latest version is to get

62
00:04:41,890 --> 00:04:47,770
pull inside the course repo so make sure you're always doing that because I'm constantly making new

63
00:04:47,770 --> 00:04:49,390
updates.

64
00:04:49,390 --> 00:04:54,100
Now though Python 3 is newer there are still reasons to use Python 2.

65
00:04:54,100 --> 00:05:00,820
For example in your work you might use Python 2 or a certain platforms like Google App Engine only support

66
00:05:01,030 --> 00:05:02,350
Python 2.

67
00:05:02,470 --> 00:05:06,030
So if you're running a web app that means you're stuck with Python 2.

68
00:05:06,190 --> 00:05:08,250
It does have great scalability features.

69
00:05:08,260 --> 00:05:14,000
So there are many good reasons to use Google app engine if you want to get more insight on whether to

70
00:05:14,000 --> 00:05:16,300
choose Python 2 or Python 3.

71
00:05:16,360 --> 00:05:18,180
Just check out the appendix lecture.

72
00:05:18,250 --> 00:05:23,990
Python 2 versus Python 3.

73
00:05:24,040 --> 00:05:28,520
So now that we've downloaded the install file all we need to do is click on it.

74
00:05:28,540 --> 00:05:33,030
That's what I mean by one click install you click on this hero.

75
00:05:33,060 --> 00:05:34,960
Okay a few times and everything is done.

76
00:05:43,040 --> 00:05:48,620
Unfortunately I gave my user name a space which kind of sucks but that's what happened so I'm sure some

77
00:05:48,620 --> 00:05:50,510
of you have a space in your user name too.

78
00:05:50,540 --> 00:05:53,930
So if I come across any issues at least you'll know what to do.

79
00:06:04,020 --> 00:06:04,420
All right.

80
00:06:04,440 --> 00:06:09,960
So everything's installed so essentially everything except the deploying libraries have already been

81
00:06:09,990 --> 00:06:16,200
automatically installed so you don't need to manually install them by side by map live.

82
00:06:16,290 --> 00:06:23,480
And as I Python or cycle learn so if you're taking my name pi course or any course that doesn't use

83
00:06:23,480 --> 00:06:27,890
modern deep learning libraries you already have everything you need.

84
00:06:28,010 --> 00:06:33,630
So let's go into AI python and make sure that's the case to start a python.

85
00:06:33,630 --> 00:06:40,240
I go to these start menu type in Anaconda and then this Anaconda prompt application should pop up.

86
00:06:40,320 --> 00:06:43,430
Actually it should pop up before you even finish typing Anaconda.

87
00:06:51,850 --> 00:06:56,400
So we go into there and this brings up a command line terminal next.

88
00:06:56,450 --> 00:06:57,970
You just type in AI Python

89
00:07:05,380 --> 00:07:08,490
after that we can import all the libraries I mentioned earlier.

90
00:07:08,560 --> 00:07:11,880
If we don't get an error that means that they've been installed successfully

91
00:07:40,670 --> 00:08:00,360
so let's try something simple like generating some random numbers and making a plot.

92
00:08:00,530 --> 00:08:02,270
So that's a plot of random noise

93
00:08:06,160 --> 00:08:07,660
let's make a histogram to

94
00:08:18,420 --> 00:08:18,560
it.

95
00:08:18,560 --> 00:08:21,020
So we see a normal curve just like we expect

96
00:08:27,090 --> 00:08:32,380
and you can see that tensor flow is not installed which is why we get this error but we can install

97
00:08:32,380 --> 00:08:38,080
it very easily by exiting I python and then typing in pip install tensor flow

98
00:08:47,030 --> 00:08:49,310
next let's try to install Kerry's

99
00:08:52,280 --> 00:08:53,650
so we get this error.

100
00:08:53,750 --> 00:09:00,500
So I looked this up and determined that we need to update Pip so let's do that by typing in Canada install

101
00:09:00,500 --> 00:09:04,000
Pip kinda kind of works like pip in that way.

102
00:09:04,000 --> 00:09:06,070
They are all just tools for installing stuff.

103
00:09:11,480 --> 00:09:14,010
Now let's try pip install carrots again

104
00:09:22,040 --> 00:09:22,470
all right.

105
00:09:22,510 --> 00:09:23,470
So everything works

106
00:09:26,760 --> 00:09:31,050
next let's try to install an LTE K this is used in my A.P. courses

107
00:09:36,090 --> 00:09:39,240
so it looks like it's already installed so there's nothing more to do.

108
00:09:40,780 --> 00:09:44,920
Just keep in mind if we come across a library you don't care about feel free to ignore it.

109
00:09:45,550 --> 00:09:50,170
I find it's useful just to install everything at the same time so that when you're deep in the code

110
00:09:50,170 --> 00:09:52,660
later you don't have to think about stuff like this

111
00:09:56,110 --> 00:09:59,000
so the next thing will install is C.A. A.K..

112
00:09:59,320 --> 00:10:02,440
This is Microsoft's Deep Learning library.

113
00:10:02,470 --> 00:10:04,270
Notice how it's not part of Pip.

114
00:10:04,270 --> 00:10:12,010
So you need to grab your realm manually from Microsoft's Web site unfortunately it's a little hard to

115
00:10:12,010 --> 00:10:17,230
find because there are many pages that deal with how to install C A.K. on Microsoft's Web site.

116
00:10:17,710 --> 00:10:24,130
But what you're looking for is a page that has a link to a W H L file so copy and paste that after pip

117
00:10:24,130 --> 00:10:25,270
install.

118
00:10:25,360 --> 00:10:30,340
This is a good example because it shows you another way you can use Pip by doing pip install and then

119
00:10:30,340 --> 00:10:31,030
a you URL

120
00:10:46,670 --> 00:10:49,440
next let's install pi talk.

121
00:10:49,460 --> 00:10:51,580
This requires us to use a custom source.

122
00:10:51,620 --> 00:10:56,990
So we have to specify the option minus C. Peter Gacy one two three.

123
00:10:56,990 --> 00:11:00,280
So that's kinda install minus C. Peter Gacy.

124
00:11:00,290 --> 00:11:02,420
One two three pi talk.

125
00:11:02,420 --> 00:11:08,600
This is because a very nice guy called Peter Gacy one two three has provided us with a version of Patrick

126
00:11:08,780 --> 00:11:16,140
that works on Windows and once that's all done we can verify that they've been installed correctly by

127
00:11:16,140 --> 00:11:17,780
going back to a Python

128
00:11:33,180 --> 00:11:33,460
all right.

129
00:11:33,460 --> 00:11:38,000
So tensor flow works Kerry's works

130
00:11:41,460 --> 00:11:42,590
and l T.K. works

131
00:11:45,650 --> 00:11:46,980
C and T.K. works

132
00:11:50,390 --> 00:11:51,360
and torture works

133
00:11:59,300 --> 00:11:59,880
next.

134
00:11:59,900 --> 00:12:00,610
Let's and stuff.

135
00:12:00,620 --> 00:12:07,930
Yano V.A. has historically been pretty difficult to install on Windows but nowadays that's not the case.

136
00:12:07,970 --> 00:12:11,130
So if you go to their website you'll see a bunch of instructions.

137
00:12:11,360 --> 00:12:15,020
If you don't want to use the GP you or you don't have a GP you.

138
00:12:15,020 --> 00:12:16,930
Then the instructions will be very easy.

139
00:12:17,420 --> 00:12:22,330
I don't have a GP you on this machine so I'm going to do the easy version.

140
00:12:22,340 --> 00:12:26,710
Keep in mind that V.A. is really great for learning purposes so it's totally fine.

141
00:12:26,810 --> 00:12:32,450
Even if you have a GP you to just install the CPE you version for now and then use the GP you version

142
00:12:32,450 --> 00:12:34,650
of tensor flow.

143
00:12:34,670 --> 00:12:39,830
Now I ended up upgrading MPL service and lip Python since that's what they told me to do on Vienna's

144
00:12:39,890 --> 00:12:42,980
website but it looked like these were already installed.

145
00:12:42,980 --> 00:12:50,340
In fact updating MPL service gave me an issue later so we'll have to fix that so if you want to install

146
00:12:50,340 --> 00:12:57,570
V.A. for CB you only that's kinda installed V.A. if you want to install V.A. for the GP you then do

147
00:12:57,600 --> 00:12:59,940
kinda install piano pi GP you

148
00:13:29,370 --> 00:13:32,270
now let me go into a python and check if piano works

149
00:13:41,880 --> 00:13:46,700
so we get an error because of this MPL service thing that I mentioned earlier.

150
00:13:46,920 --> 00:13:49,890
So let's set this environment variable it's telling me to set

151
00:13:58,270 --> 00:14:03,570
by the way this is great to know if you don't yet know how to set environment variables on windows.

152
00:14:03,880 --> 00:14:06,880
We can also check that I worked by using the echo command

153
00:14:14,120 --> 00:14:20,770
so let's try that again let's do a simple example of adding two numbers in piano just to make sure everything's

154
00:14:20,770 --> 00:14:21,510
working.

155
00:14:59,110 --> 00:15:04,120
If you want to do something even more complicated you can run this script from deplaning Part 2 which

156
00:15:04,120 --> 00:15:11,350
doesn't require any external data set so just go over to the folder and in class 2 and type in Python.

157
00:15:11,350 --> 00:15:16,690
Grid search that pie so that's going to look for hyper parameters using cross validation

158
00:15:23,220 --> 00:15:25,240
now in this last section of this lecture.

159
00:15:25,320 --> 00:15:30,280
We're going to talk about reinforcement learning when we start studying reinforcement learning.

160
00:15:30,300 --> 00:15:34,950
There is yet another library we'll need to install called Open a gym.

161
00:15:35,070 --> 00:15:40,050
If you don't plan on learning reinforcement learning you can skip this part of the lecture.

162
00:15:40,060 --> 00:15:42,430
This has also historically been very difficult.

163
00:15:42,640 --> 00:15:47,760
But luckily the open source community has put in the work so you don't have to.

164
00:15:47,860 --> 00:15:52,690
You're welcome to read through the github issue on this if you want but I'm going to just do the simplest

165
00:15:52,690 --> 00:15:54,200
thing that works.

166
00:15:54,430 --> 00:15:56,530
So let's first do pip install Jim

167
00:16:05,740 --> 00:16:10,450
great So that worked.

168
00:16:10,480 --> 00:16:12,550
Now the second command is a bit longer.

169
00:16:12,550 --> 00:16:19,090
So let's go to the actual GitHub issue and copy and paste the command the easiest way to get there is

170
00:16:19,090 --> 00:16:24,760
just to go to Google and type in install open AGM windows Anaconda or something along those lines

171
00:16:49,680 --> 00:16:50,730
so let's paste that in

172
00:17:00,240 --> 00:17:06,040
and notice how it feels since I haven't yet installed yet so we can install get by doing condo install

173
00:17:06,040 --> 00:17:10,720
yet.

174
00:17:10,730 --> 00:17:11,680
Now let's try it again

175
00:17:18,520 --> 00:17:23,620
unfortunately this fails again because we need DCC which is a C compiler.

176
00:17:23,620 --> 00:17:31,330
Now one way to get GCSE is to do condo install M2 w 64 tool chain but unfortunately I tried this and

177
00:17:31,330 --> 00:17:32,440
it also doesn't work.

178
00:17:32,470 --> 00:17:37,890
In fact I think this tool chain was installed already so I tried quite a few things that didn't work.

179
00:17:37,900 --> 00:17:44,350
So in order to save you some time I'm going to recommend you only try this stuff on this page if everything

180
00:17:44,350 --> 00:17:45,850
else doesn't work for you.

181
00:17:46,060 --> 00:17:52,490
So it worked for me was to just grab the pre compiled binary directly now in order to do that.

182
00:17:52,490 --> 00:17:59,720
You'll want to go to control his GitHub repo directly so that's this your URL here GitHub dot com slash

183
00:17:59,720 --> 00:18:06,420
cordially slash Atari dash pi slash releases next.

184
00:18:06,470 --> 00:18:12,740
You want to download the w h file that matches your environment so I have Python three point six on

185
00:18:12,740 --> 00:18:15,360
a 64 bit installation of Windows.

186
00:18:15,470 --> 00:18:16,840
So this is the file I want.

187
00:18:18,210 --> 00:18:23,850
Luckily we already discussed earlier in this lecture how to install a w h file that's just pip install

188
00:18:23,880 --> 00:18:25,260
and then the path to the file.

189
00:18:25,380 --> 00:18:26,130
So let's do that

190
00:18:40,800 --> 00:18:45,510
now we can test our installation by running a script that requires an Atari game.

191
00:18:45,750 --> 00:18:49,220
So let's see over to our L2 and then Atari.

192
00:18:49,470 --> 00:18:52,410
And now let's run Daegu n underscore t after PI

193
00:19:00,090 --> 00:19:08,470
call so everything's good.

194
00:19:08,550 --> 00:19:15,660
Now the final thing we want to do for open again is if you want to play a video or save a video you

195
00:19:15,660 --> 00:19:24,870
want to install FSM pig so to do that you want to type in Canada install minus C men Po f f MPEG

196
00:19:29,780 --> 00:19:36,440
once you've done that you can go to the capo folder and type in Python and save a video da pi and this

197
00:19:36,440 --> 00:19:42,290
will run a script that will play the carpool game show a plan and then save a video.

198
00:19:49,380 --> 00:19:53,990
And of course you can also play this video by just navigating to the file and clicking on it.

199
00:20:08,710 --> 00:20:10,450
So for now that's everything.

200
00:20:10,450 --> 00:20:15,820
If I need to add new libraries or updates to this lecture they will be appended at the end.
