1
00:00:02,150 --> 00:00:04,370
Everyone and welcome back to this class

2
00:00:07,730 --> 00:00:13,220
in this lecture I'm going to go over a better way to install data science and machine learning libraries

3
00:00:13,220 --> 00:00:16,040
for Python for Windows users.

4
00:00:16,040 --> 00:00:20,750
Historically Windows users have had a lot of problems installing this stuff.

5
00:00:20,750 --> 00:00:26,540
Luckily these days there is an option that makes things very painless and just as easy as they are on

6
00:00:26,540 --> 00:00:29,660
Linux or Mac that is Anaconda.

7
00:00:30,020 --> 00:00:34,090
In fact even if you're not on Windows you can still use Anaconda.

8
00:00:34,220 --> 00:00:38,860
It's nice because it isolates your environment from the defaults provided on your system.

9
00:00:38,870 --> 00:00:45,760
So for example you can have Python 3 in Anaconda but Python 2 as your system default.

10
00:00:45,810 --> 00:00:50,910
When I first started these courses I wasn't keen on Windows since there were a few central libraries

11
00:00:50,910 --> 00:00:54,730
that couldn't be installed on Windows without a significant amount of effort.

12
00:00:54,840 --> 00:01:01,390
If at all in my view anything beyond a couple of lines in the console or clicking an install file is

13
00:01:01,390 --> 00:01:02,220
too much.

14
00:01:02,380 --> 00:01:07,440
And believe me some students even have trouble with that so it's good not to make things too complicated

15
00:01:07,450 --> 00:01:09,720
before you can even begin the course.

16
00:01:10,110 --> 00:01:12,070
Nowadays that has changed.

17
00:01:12,400 --> 00:01:18,370
It's a lot easier to install things on Windows in large part thanks to Anaconda and so this lecture

18
00:01:18,370 --> 00:01:23,380
is all about how to install all the data science and machine learning libraries you'll need on Windows

19
00:01:23,470 --> 00:01:25,570
using Anaconda.

20
00:01:25,570 --> 00:01:30,820
So in this lecture I'm going to walk you through how to install Anaconda as well as some of the libraries

21
00:01:30,820 --> 00:01:33,670
you might need that don't already come with Anaconda.

22
00:01:34,550 --> 00:01:39,480
You'll find that most of the common libraries such as spy and Siple are already included.

23
00:01:39,500 --> 00:01:43,250
So if that's all you want to use then for you it's just a one click install

24
00:01:48,280 --> 00:01:49,030
on this slide.

25
00:01:49,030 --> 00:01:53,680
I'm going to give you a super short summerize version of this lecture so you don't have to walk through

26
00:01:53,680 --> 00:01:56,400
the installation with me if you don't want to.

27
00:01:56,440 --> 00:01:59,030
For some people that really helps since you can see it.

28
00:01:59,050 --> 00:02:04,840
But if you can do it on your own feel free so number one.

29
00:02:04,860 --> 00:02:07,200
Download and install Anaconda.

30
00:02:07,200 --> 00:02:08,970
This is just a one click install.

31
00:02:09,000 --> 00:02:13,390
It already includes some supply supply not plugged lib and pandas.

32
00:02:13,410 --> 00:02:15,760
That's all we need for the stack in Python.

33
00:02:15,780 --> 00:02:20,790
Linear regression and logistic regression and a few more courses.

34
00:02:20,830 --> 00:02:26,560
It also comes with NLC K which is what we use for an LP and psyche learn which has some pre-built machine

35
00:02:26,560 --> 00:02:31,930
learning models now even though this stuff comes by default.

36
00:02:32,010 --> 00:02:37,140
You can still update them if you want so you can do Conder update an umpire for example and that will

37
00:02:37,140 --> 00:02:43,410
update by number 2 install deep learning libraries.

38
00:02:43,450 --> 00:02:49,700
If God Pippin's start tensor flow that's going to install tens of flow and if you want to install Karris

39
00:02:49,720 --> 00:02:55,900
you have to first do Konda in stoppit which is going to update Pipp and then you can install keras using

40
00:02:55,900 --> 00:02:57,610
Pipp install Khera us.

41
00:02:57,760 --> 00:03:02,070
If you don't update Pipp first you might get an error.

42
00:03:02,100 --> 00:03:05,680
We have a C in Teekay which is Microsoft's deep learning library.

43
00:03:05,760 --> 00:03:11,760
So you do Pipp install and then the C and Teekay euro which you can get from Microsoft's website.

44
00:03:12,030 --> 00:03:16,910
So I'm not posting any you are all here because the version could likely change in the future.

45
00:03:17,090 --> 00:03:22,310
And so you can Google search how to install CNC K and you can get a euro just like this.

46
00:03:24,450 --> 00:03:25,690
Next we have Pitre.

47
00:03:25,740 --> 00:03:28,270
That's Konda and start minus see Peter.

48
00:03:28,330 --> 00:03:31,410
See 2:59 pie toward.

49
00:03:31,500 --> 00:03:38,200
After that we have C.A. So that's Konda and start piano or Konda install Viendo you.

50
00:03:38,340 --> 00:03:45,900
If you have an Nvidia you and you've installed the Kuta tool kit already.

51
00:03:46,120 --> 00:03:50,400
Number three install open a gym that's just Pipp installed Jim.

52
00:03:50,440 --> 00:03:55,630
If you want to be able to play Atari games also then that's more involved so just skip to the end of

53
00:03:55,630 --> 00:04:02,850
this lecture where I walk through that if you want to play and save videos using opening gym then you

54
00:04:02,850 --> 00:04:04,860
also have to install FFM MPEG

55
00:04:10,180 --> 00:04:13,710
So the first thing we're going to do is go over to the Anaconda Web site.

56
00:04:13,750 --> 00:04:16,830
That's an icon a dot com slash download.

57
00:04:16,960 --> 00:04:23,130
Scroll down to the window section and click on either Python 3.6 or Python 2.7.

58
00:04:23,410 --> 00:04:26,340
Or if you're watching this lecture in the future and there's a new version.

59
00:04:26,350 --> 00:04:32,100
Get that the code in my courses is compatible with both Python 2 and Python 3.

60
00:04:32,110 --> 00:04:37,660
So in that regard it doesn't really matter which when you get in the lectures you might see Python to

61
00:04:37,660 --> 00:04:38,120
code.

62
00:04:38,200 --> 00:04:44,970
But the best way to make sure you're seeing the latest version is to get Paul inside because repo so

63
00:04:44,970 --> 00:04:49,220
make sure you're always doing that because I'm constantly making new updates.

64
00:04:49,350 --> 00:04:53,960
Now though Python 3 is newer There are still reasons to use Python too.

65
00:04:54,090 --> 00:05:00,810
For example in your work you might use Python 2 or certain platforms like Google App Engine only support

66
00:05:01,050 --> 00:05:02,120
Python too.

67
00:05:02,460 --> 00:05:06,030
So if you are running a web app that means you're stuck with Python too.

68
00:05:06,090 --> 00:05:12,180
It does have great scalability features so there are many good reasons to use Google App Engine if you

69
00:05:12,180 --> 00:05:16,340
want to get more insight on whether to choose Python 2 or Python 3.

70
00:05:16,350 --> 00:05:20,390
Just check out the appendix lecture Python 2 vs Python 3.

71
00:05:24,010 --> 00:05:28,240
So now that we've downloaded the install file all we need to do is click on it.

72
00:05:28,540 --> 00:05:32,860
That's what I mean by one click install you click on this.

73
00:05:32,920 --> 00:05:43,000
OK a few times and everything is done.

74
00:05:43,020 --> 00:05:47,670
Unfortunately I gave my username a space which kind of sucks but that's what happened.

75
00:05:47,820 --> 00:05:50,490
So I'm sure some of you have a space in your username too.

76
00:05:50,520 --> 00:05:54,080
So if I come across any issues at least you'll know what to do.

77
00:06:03,980 --> 00:06:05,800
All right so everything's installed.

78
00:06:05,870 --> 00:06:12,400
So essentially everything except that the libraries have already been automatically installed so you

79
00:06:12,400 --> 00:06:20,530
don't need to manually install them Paice I buy Matlab live and as I Python or sikat learn so if you're

80
00:06:20,530 --> 00:06:25,990
taking my non-pilot course or any course that doesn't use modern deep learning libraries you already

81
00:06:25,990 --> 00:06:27,750
have everything you need.

82
00:06:27,970 --> 00:06:30,810
So let's go into Python and make sure that's the case.

83
00:06:32,430 --> 00:06:39,270
To start Python I go to the start menu type in Anaconda and then this anaconda prompt application should

84
00:06:39,270 --> 00:06:40,280
pop up.

85
00:06:40,290 --> 00:06:51,780
Actually it should pop up before you even finish typing Anaconda.

86
00:06:51,830 --> 00:06:55,470
So we go into there and this brings up a command line terminal.

87
00:06:55,970 --> 00:07:05,340
Next type in Python.

88
00:07:05,360 --> 00:07:08,440
After that we can import all the libraries I mentioned earlier.

89
00:07:08,540 --> 00:07:40,530
If we don't get an error that means they've been installed successfully.

90
00:07:40,650 --> 00:07:44,760
So let's try something simple like generating some random numbers and making a plot

91
00:08:00,390 --> 00:08:06,150
so that's a plot of random noise.

92
00:08:06,160 --> 00:08:07,660
Let's make a histogram to

93
00:08:18,400 --> 00:08:21,120
it so we see a normal curve just like we expect.

94
00:08:27,170 --> 00:08:31,300
You can see that tensor flow is not installed which is why we get this error.

95
00:08:31,560 --> 00:08:38,070
But we can install it very easily by accepting Python and then typing in Pipp install tensor flow

96
00:08:47,000 --> 00:08:47,680
next.

97
00:08:47,720 --> 00:08:49,280
Let's try to install carious

98
00:08:52,250 --> 00:08:53,700
so we get this error.

99
00:08:53,720 --> 00:09:00,350
So I looked this up and determine that we need to update PIP so let's do that by typing in Konda install

100
00:09:00,350 --> 00:09:06,230
stoppit Kondo kind of works like pipin that way they are all just tools for installing stuff.

101
00:09:11,340 --> 00:09:14,220
Now let's try Pippin's carrots again.

102
00:09:22,170 --> 00:09:22,460
All right.

103
00:09:22,480 --> 00:09:23,460
So everything works

104
00:09:26,740 --> 00:09:35,860
next let's try to install and T.K. this is used in my and AP courses.

105
00:09:36,070 --> 00:09:37,930
So it looks like it's already installed.

106
00:09:37,930 --> 00:09:39,530
So there's nothing more to do.

107
00:09:40,710 --> 00:09:43,840
Just keep in mind if we come across a library you don't care about.

108
00:09:43,840 --> 00:09:45,440
Feel free to ignore it.

109
00:09:45,520 --> 00:09:50,140
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,140 --> 00:09:56,050
later you don't have to think about stuff like this.

111
00:09:56,090 --> 00:10:01,680
So the next thing will install is C. A.K. This is Microsoft's deep learning library.

112
00:10:02,460 --> 00:10:04,190
Notice how it's not part of Pipp.

113
00:10:04,260 --> 00:10:10,410
So you need to Gravier your role manually from Microsoft's Web site.

114
00:10:10,420 --> 00:10:14,800
Unfortunately it's a little hard to find because there are many pages that deal with how to install

115
00:10:14,840 --> 00:10:17,390
the A.K. on Microsoft's Web site.

116
00:10:17,710 --> 00:10:22,100
But what you're looking for is a page that has a link to a W H L file.

117
00:10:22,360 --> 00:10:27,880
So copy and paste that after Pipp install this is a good example because it shows you another way you

118
00:10:27,880 --> 00:10:31,060
can use Pipp by doing Pipp install and then a Yoro

119
00:10:46,650 --> 00:10:49,400
next let's install Torc.

120
00:10:49,420 --> 00:10:55,970
This requires us to use a custom source so we have to specify the option minus see Peter J.C one two

121
00:10:55,980 --> 00:10:56,900
three.

122
00:10:56,980 --> 00:10:59,420
So that's Konda install minus see.

123
00:10:59,450 --> 00:11:02,310
Peter Casey 2:59 by Torc.

124
00:11:02,410 --> 00:11:09,070
This is because a very nice guy called PIERGROSSI 2:59 has provided us with a version of Pi torch that

125
00:11:09,070 --> 00:11:16,490
works on Windows and once that's all done we can verify that they've been installed correctly by going

126
00:11:16,490 --> 00:11:18,020
back to Python.

127
00:11:33,140 --> 00:11:33,440
All right.

128
00:11:33,440 --> 00:11:35,120
So tensor flow works.

129
00:11:41,790 --> 00:11:42,590
K works

130
00:11:45,640 --> 00:11:46,960
see and T.K. works

131
00:11:50,380 --> 00:11:51,340
and torch works

132
00:11:59,280 --> 00:12:00,590
next letters and stuff.

133
00:12:00,600 --> 00:12:06,840
Yanno Viendo has historically been pretty difficult to install on Windows but nowadays that's not the

134
00:12:06,840 --> 00:12:07,950
case.

135
00:12:07,950 --> 00:12:11,200
So if you go to their Web site you'll see a bunch of instructions.

136
00:12:11,340 --> 00:12:16,410
If you don't want to use the GPS you or you don't have a GPS you then the instructions will be very

137
00:12:16,410 --> 00:12:17,390
easy.

138
00:12:17,400 --> 00:12:21,250
I don't ever keep you on this machine so I'm going to do the easy version.

139
00:12:22,340 --> 00:12:25,400
Keep in mind that Viendo is really great for learning purposes.

140
00:12:25,430 --> 00:12:26,780
So it's totally fine.

141
00:12:26,780 --> 00:12:32,900
Even if you have AGP you to just install the CPQ version for now and then use the GPU version of tensor

142
00:12:32,940 --> 00:12:34,820
for now.

143
00:12:34,820 --> 00:12:39,940
I ended up upgrading MKR service and lib Python since that's what they told me to do on Vienna's Web

144
00:12:39,940 --> 00:12:40,520
site.

145
00:12:40,760 --> 00:12:42,910
But it looked like these were already installed.

146
00:12:42,980 --> 00:12:46,360
In fact updating MKR service gave me an issue later.

147
00:12:46,370 --> 00:12:47,680
So we'll have to fix that.

148
00:12:49,190 --> 00:12:55,850
So if you want to install CNO for you only That's kinda install CNO if you want to install Viendo for

149
00:12:55,850 --> 00:12:58,570
the cheap you then do Konda install it.

150
00:12:58,600 --> 00:12:59,930
Yanno you

151
00:13:29,360 --> 00:13:32,520
now let me go into Python and check if C.A. works.

152
00:13:41,860 --> 00:13:46,400
So we get an error because of this MKR service thing that I mentioned earlier.

153
00:13:46,900 --> 00:13:48,900
So let's set this environment variable.

154
00:13:48,910 --> 00:13:58,090
It's telling me to set.

155
00:13:58,240 --> 00:14:03,670
By the way this is great to know if you don't yet know how to set environment variables on Windows.

156
00:14:03,850 --> 00:14:14,070
We can also check that it works by using the echo command.

157
00:14:14,100 --> 00:14:16,650
So let's try that again.

158
00:14:16,690 --> 00:14:19,620
Let's do a simple example of adding two numbers MVNO.

159
00:14:19,660 --> 00:14:21,450
Just to make sure everything's working.

160
00:14:59,100 --> 00:15:04,080
If you want to do something even more complicated you can run this script from replaying part 2 which

161
00:15:04,080 --> 00:15:06,460
doesn't require any external data set.

162
00:15:06,720 --> 00:15:11,340
So just go over to the folder and in class to type in Python.

163
00:15:11,340 --> 00:15:12,000
Grid search.

164
00:15:12,040 --> 00:15:13,370
Hi.

165
00:15:13,390 --> 00:15:23,140
So that's going to look for hyper parameters using cross-validation.

166
00:15:23,200 --> 00:15:28,660
Now in this last section of this lecture we're going to talk about reinforcement learning when we started

167
00:15:28,660 --> 00:15:30,270
studying reinforcement learning.

168
00:15:30,280 --> 00:15:34,810
There is yet another library will need to install called Open a gem.

169
00:15:35,050 --> 00:15:40,070
If you don't plan on learning reinforcement learning you can skip this part of the lecture.

170
00:15:40,070 --> 00:15:45,740
This has also historically been very difficult but luckily the open source community has put in the

171
00:15:45,740 --> 00:15:46,120
work.

172
00:15:46,160 --> 00:15:47,840
So you don't have to.

173
00:15:47,840 --> 00:15:52,670
You're welcome to read through the get her issue on this if you want but I'm going to just do the simplest

174
00:15:52,670 --> 00:15:54,320
thing that works.

175
00:15:54,410 --> 00:15:56,510
So let's first do Pippin's Stajan

176
00:16:10,510 --> 00:16:12,470
now the second command is a bit longer.

177
00:16:12,490 --> 00:16:17,680
So let's go to the actual get her issue and copy and paste the command.

178
00:16:17,740 --> 00:16:23,440
The easiest way to get there is just to go to Google and type in install open gym windows anaconda or

179
00:16:23,440 --> 00:16:24,980
something along those lines.

180
00:16:49,660 --> 00:16:50,970
So let's paste that in.

181
00:17:00,220 --> 00:17:03,350
And notice how it feels since I haven't yet installed it.

182
00:17:03,580 --> 00:17:10,680
So we can install it by doing Konda install yet.

183
00:17:10,690 --> 00:17:11,930
Now let's try it again.

184
00:17:18,480 --> 00:17:23,180
Unfortunately this fails again because we need gcc which is a C compiler.

185
00:17:23,610 --> 00:17:31,320
Now one way to get gcc is to do Konda install MTU w 64 toolchain but unfortunately I tried this and

186
00:17:31,320 --> 00:17:32,450
it also doesn't work.

187
00:17:32,460 --> 00:17:35,260
In fact I think this toolchain was installed already.

188
00:17:35,580 --> 00:17:37,860
So I tried quite a few things that didn't work.

189
00:17:37,860 --> 00:17:43,520
So in order to save you some time I'm going to recommend you only try this stuff on this page.

190
00:17:43,650 --> 00:17:45,910
If everything else doesn't work for you.

191
00:17:46,020 --> 00:17:51,270
So it worked for me was to just grab the pre-compiled binary directly.

192
00:17:51,470 --> 00:17:56,000
Now in order to do that you want to go to could you please get help reports directly.

193
00:17:56,240 --> 00:17:58,210
So that's this you're out here.

194
00:17:58,370 --> 00:18:05,710
Get up Dotcom's slash cordiale slash Atari dash pie slash releases.

195
00:18:05,830 --> 00:18:10,280
Next you'll want to download the w h file that matches your environment.

196
00:18:10,700 --> 00:18:15,370
So I have Python 3.6 on a 64 bit installation of Windows.

197
00:18:15,440 --> 00:18:18,090
So this is a file I want.

198
00:18:18,190 --> 00:18:22,620
Luckily we already discussed earlier in this lecture how to install a w h file.

199
00:18:22,690 --> 00:18:25,220
That's just Pipp install and then the path to the file.

200
00:18:25,360 --> 00:18:40,660
So let's do that.

201
00:18:40,800 --> 00:18:45,560
Now we can test our installation by running a script that requires an Atari game.

202
00:18:45,750 --> 00:18:49,360
So let's see the over two or two and then Atari.

203
00:18:49,440 --> 00:18:52,410
And now let's run dequeue in underscore TFT up-I

204
00:19:00,050 --> 00:19:01,540
cool so everything's good.

205
00:19:08,520 --> 00:19:15,630
Now the final thing we want to do for open edgin is if you want to play a video or save a video you

206
00:19:15,630 --> 00:19:29,760
want to install FFM pag so to do that you want to type in Konda install mynahs see mento F-F MPEG.

207
00:19:29,780 --> 00:19:36,410
Once you've done that you can go to the card pull folder and type in Python save a video PI and this

208
00:19:36,410 --> 00:19:42,320
will run a script that will play the card pool game show a plot and then save a video

209
00:19:49,370 --> 00:19:54,200
and of course you can also play this video by just navigating to the file and clicking on it.

210
00:20:08,700 --> 00:20:10,300
So for now that's everything.

211
00:20:10,440 --> 00:20:15,600
If I need to add new libraries or updates to this lecture they will be appended at the end.
