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