YouTube2Text

Installing Anaconda For Data Science | Jupyter Notebook for Machine Learning | Google Colab for ML — Transcript

by CampusX · 6,301 words · 876 segments · language en · Watch on YouTube

Full transcript

  1. 0:00Hello guys, welcome to my YouTube
  2. 0:01channel. This is 100 Days of Machine
  3. 0:03Learning and today is day 12. I guess
  4. 0:06yeah, it is day 12. So we have studied
  5. 0:09quite a lot and since the last video,
  6. 0:10we have started practical machine
  7. 0:12learning. And I had planned to show you
  8. 0:16an end-to-end machine learning project
  9. 0:18in this video. But before that, I felt
  10. 0:22I should quickly teach you how to
  11. 0:25install all the tools. Right? So in
  12. 0:28this video, I will discuss the three
  13. 0:32most famous tools used in machine
  14. 0:36learning among all the ways to work. So
  15. 0:40after this video, you shouldn't have
  16. 0:43any problems using any of these tools.
  17. 0:45Right? That is the whole idea of this
  18. 0:47video. So we will discuss these six
  19. 0:50things in this video. First, we will
  20. 0:52install software named Anaconda. So if
  21. 0:56you want to do machine learning on
  22. 0:58Windows or other operating systems,
  23. 1:01Anaconda is the best platform right now
  24. 1:04. It is the best software. Because what
  25. 1:07Anaconda does is, it handles all the
  26. 1:09data science packages you will use. See
  27. 1:11, in data science, you have to use a
  28. 1:13lot of packages and libraries. So
  29. 1:15installing them all by yourself could
  30. 1:16be hectic. So Anaconda provides you
  31. 1:19with all the installations in one place
  32. 1:21. And then what can you do? You can
  33. 1:23start your work directly. So that is
  34. 1:25the whole idea behind Anaconda. And at
  35. 1:27this point, it is the most popular data
  36. 1:30science platform. Let me show you. So
  37. 1:33if you Google Anaconda, this is the
  38. 1:36website. They have even written "the
  39. 1:39most popular data science platform."
  40. 1:42You just need to go there, go to
  41. 1:44products, and download the individual
  42. 1:46edition. See, I clicked on download.
  43. 1:52You need to select your operating
  44. 1:53system. In my case, it is 64-bit
  45. 1:55Windows. And that's it, guys. You just
  46. 2:01need to download it. It is a slightly
  47. 2:04large software. It would take around
  48. 2:07450 MB, it is a bit large. But yeah,
  49. 2:11you have to download it and then
  50. 2:13install it. I will just pause this
  51. 2:15video. So yeah, as you can see, it is
  52. 2:17downloaded. Now you just need to
  53. 2:18install it, and the installation is
  54. 2:20very simple. You just have to click
  55. 2:22next, next, next, and finish. Uh. See,
  56. 2:26keep everything at default. In my case,
  57. 2:29this software is already installed. So
  58. 2:31I am not installing this again. But you
  59. 2:33just simply have to install it with
  60. 2:36custom settings. That's it. Okay? So I
  61. 2:38will cancel the installation. And I
  62. 2:40will tell you what to do after this. So
  63. 2:42Anaconda is installed for us. Now in
  64. 2:45Anaconda, you have multiple things that
  65. 2:47you can work on. Like one is Spyder. So
  66. 2:50Spyder is one of the tools that comes
  67. 2:53with Anaconda using which you can
  68. 2:55directly run machine learning or Python
  69. 2:58codes. Okay? I will just let it open.
  70. 3:03Here it is. Okay? Here, what you can do
  71. 3:06is you can directly run machine
  72. 3:08learning related code. Many people
  73. 3:11prefer Anaconda. Although I don't
  74. 3:14really, I'm sorry, many people prefer
  75. 3:16Spyder. But I am not one of those. I
  76. 3:20like another tool more. You can see
  77. 3:23this entire interface is very simple.
  78. 3:24The advantage of this particular
  79. 3:27interface is that this tool can display
  80. 3:29your data and such very well. Okay? But
  81. 3:33I don't prefer it. I mean, it is up to
  82. 3:35you. If you want, you can use Spyder.
  83. 3:37But I personally use Jupyter. Okay,
  84. 3:40which I feel is even more famous. You
  85. 3:43have to search for Jupyter Notebook
  86. 3:45once you have installed it, and once
  87. 3:48you open it, a black console will
  88. 3:50appear first and after that, you will
  89. 3:52see this window in your browser and you
  90. 3:55work from here. Okay? So let me show
  91. 3:58you how we are doing this work. What I
  92. 4:00will do is I will just minimize this
  93. 4:02window and see, what do you have to do?
  94. 4:06First of all, whenever you are starting
  95. 4:08a project, you create a new folder.
  96. 4:11Okay? Now you cannot see if anything
  97. 4:13happened or not. But if you go down, an
  98. 4:15untitled folder has been created here.
  99. 4:17I am checking this and I am renaming it
  100. 4:21. As "100 Days of ML," and now this
  101. 4:26folder of mine has been renamed. Now I
  102. 4:30went inside it and there is nothing
  103. 4:32here right now. Okay? Now what you can
  104. 4:34do here is you can create a new Python
  105. 4:38notebook. Okay? Notebook means Jupyter
  106. 4:40Notebook. So if you create a Python 3
  107. 4:43notebook here, then you will get
  108. 4:45something like this. This is what we
  109. 4:47call Jupyter Notebook. It is a very
  110. 4:50powerful and very useful tool. This is
  111. 4:52the reason why I don't prefer Spyder.
  112. 4:54Instead, I love using Jupyter Notebook.
  113. 4:57Because here you get a notebook-like
  114. 4:59interface. Okay? Now, what can you do
  115. 5:01here? You can do two things here.
  116. 5:04Either you can run your Python code.
  117. 5:07When code mode is selected here, you
  118. 5:10can run code in Python. Like this. I
  119. 5:14pressed Shift-Enter here and I got the
  120. 5:16output. If you press Enter here, you
  121. 5:18will go to the next line. You have to
  122. 5:20press Shift-Enter. And if you want, you
  123. 5:23can write Markdown here. So what is
  124. 5:25Markdown? Markdown is a way of writing
  125. 5:27text. Okay? Like let's say you want to
  126. 5:30create a sort of notebook for yourself.
  127. 5:32Like you are covering the first topic,
  128. 5:35uh, import data set. Okay? Import data
  129. 5:41set. And as soon as you hit Enter. Oh
  130. 5:43oh sorry, I need to select Markdown
  131. 5:46here, see. And now I ran it. You can
  132. 5:49see here a really cool, kind of textual
  133. 5:53, a nice web page has been created.
  134. 5:56Right? If I select Markdown again here
  135. 5:59and what can I do here? I can simply
  136. 6:02write something like, uh, over here. We
  137. 6:08will import the data set. Okay? And the
  138. 6:12text will appear here like this. Okay?
  139. 6:14So if you want to run code, you have to
  140. 6:16select code here. If you want to add
  141. 6:18this kind of text in between your
  142. 6:20notebook, then you have to select
  143. 6:21Markdown. Okay? You can also select
  144. 6:23headings. But to be honest, you can do
  145. 6:24headings using Markdown as well. If
  146. 6:27your Markdown is selected, then if you
  147. 6:29add a single hash, it will become your
  148. 6:32first-level heading. If you add two
  149. 6:36hashes, it will become a slightly
  150. 6:39smaller sub-heading. I hope you are
  151. 6:42understanding this thing. Okay? If you
  152. 6:44write normally, it will appear as a
  153. 6:45paragraph. If you want, you can also
  154. 6:47write HTML here. Okay? If you want, you
  155. 6:49can also write HTML here if you know
  156. 6:51HTML. Okay? If I write hello here and
  157. 6:55here I write style equals color red,
  158. 7:00see, it came in red color. Okay? So
  159. 7:04this means that you can add videos here
  160. 7:06. If you want, you can add images here,
  161. 7:10and I have seen people use this feature
  162. 7:12very well to create great notebooks.
  163. 7:16And you will find many such notebooks
  164. 7:18at the gate. Right? So, this is the
  165. 7:20best part about Jupyter Notebook that I
  166. 7:22personally love. First of all, you can
  167. 7:25run your code cell by cell. That is the
  168. 7:28best thing. Then you can write a lot of
  169. 7:30markdown to describe it. Right? Apart
  170. 7:33from this, there are many other
  171. 7:34features here too. You can add
  172. 7:36interactive widgets if you want. Right?
  173. 7:39If you want, well, I will teach you in
  174. 7:42another video how to add widgets for
  175. 7:45user interaction. Like you can add
  176. 7:49buttons, range sliders, or form fields.
  177. 7:53So, you can do a lot of things like
  178. 7:54this in your Jupyter Notebook. In short
  179. 7:56, it is a very powerful tool. And
  180. 7:58nowadays, people working in data
  181. 8:01science prefer Jupyter Notebook a lot.
  182. 8:03They like it very much. And by writing
  183. 8:06in this, a good culture of knowledge
  184. 8:08sharing has been set up among people.
  185. 8:11Right? So, what I would suggest is that
  186. 8:13if you are seeing all this for the
  187. 8:15first time, go ahead and use this tool
  188. 8:17without fear. Right? There are many
  189. 8:19other options here as well. Like
  190. 8:20running, shutting down the kernel, or
  191. 8:24adding new cells. Right? Right? There
  192. 8:27are many different features. I am not
  193. 8:28going into the basics because this
  194. 8:30video is not about Jupyter Notebook.
  195. 8:32This video is about setting up your
  196. 8:34tools. Right? I will quickly show you
  197. 8:37one thing, let's say you want to import
  198. 8:40a dataset. How would you do that? Right
  199. 8:43? So 99%of the time, the datasets you
  200. 8:46get will be from Kaggle. Right? So I
  201. 8:48will go to Kaggle and I will just
  202. 8:50download a dataset. I will download any
  203. 8:53one dataset. Uh Let's say this one. I
  204. 8:57am downloading this dataset. It is a 2
  205. 8:59MB dataset. This is the dataset. Called
  206. 9:03age train. Now I have downloaded it.
  207. 9:06Obviously, to download, you will first
  208. 9:08have to log in to Kaggle. And it's done
  209. 9:12. And now what do I have to do? I am
  210. 9:14extracting it to the desktop. So you
  211. 9:20can see at this point, my dataset is on
  212. 9:22the desktop. Right? Now what do I have
  213. 9:24to do? First of all, I will go back to
  214. 9:27this folder that I just created, 100
  215. 9:29Days of ML. Now, I will click on upload
  216. 9:32here. And from here, I will go to the
  217. 9:35desktop, select this dataset, and open
  218. 9:38it. An upload option will appear here.
  219. 9:40And look, it has been uploaded here. So
  220. 9:42, that is how you upload datasets to
  221. 9:44your folder. Now, if you want to see
  222. 9:47how this dataset looks, it appears like
  223. 9:49this. Okay? But if you want to bring it
  224. 9:52into your Jupyter notebook, you will
  225. 9:54need to learn a bit of Pandas. At this
  226. 9:57point, I would suggest that you learn
  227. 10:00NumPy and Pandas. Playlists for both
  228. 10:03are available on my channel. I will add
  229. 10:05the links to both playlists in the
  230. 10:07description of this video. This weekend
  231. 10:10, if you want, you can quickly learn
  232. 10:12Pandas and NumPy; meanwhile, I will
  233. 10:14quickly show you how to import Pandas
  234. 10:17to bring that dataset here. So what you
  235. 10:21do is just write pd dot, there is a
  236. 10:24function called read_csv, and since
  237. 10:27both files are in the same folder, I
  238. 10:30will just copy the name of this file
  239. 10:33like this, run it, and here is our data
  240. 10:36, guys. Okay? So there are 19,000 rows
  241. 10:39and 14 columns, and if I want, I can
  242. 10:42store this in a variable. Generally, we
  243. 10:44call this variable 'df'. 'df' stands
  244. 10:46for DataFrame, which is a Pandas object
  245. 10:48. So, yeah, okay? So, that is how you
  246. 10:51use Anaconda and Jupyter. Now, there
  247. 10:54are many small tips and tricks here
  248. 10:56that I have learned slowly over the
  249. 10:58years. You can also learn by
  250. 10:59experimenting if you want. But I have
  251. 11:01taught you all the basics you need. Now
  252. 11:03, let's say you want to download this
  253. 11:05notebook, you can download it as well.
  254. 11:07Okay? You can download it in any format
  255. 11:09. As Python, as HTML, as PDF, or if you
  256. 11:13want, as an ipynb notebook, which is
  257. 11:15the format it is in, and after
  258. 11:17downloading, you can easily upload it
  259. 11:20to your GitHub account. Okay? So,
  260. 11:23that's it. This was the first part we
  261. 11:25needed to cover in this video. First,
  262. 11:28how to install Anaconda. And second, to
  263. 11:31give you a brief introduction to
  264. 11:32Jupyter Notebook. Okay? Now, I will
  265. 11:34teach you something new, which is how
  266. 11:36to create a virtual environment. And I
  267. 11:38will also tell you why creating a
  268. 11:40virtual environment is important. Okay?
  269. 11:42So now, guys, let's discuss what a
  270. 11:44virtual environment is. Okay? So, if
  271. 11:47you normally go to your Start menu and
  272. 11:50search for Jupyter to start it, what
  273. 11:53happens is that it uses a common
  274. 11:55installation. From where Jupyter is
  275. 11:58running. All the libraries are already
  276. 12:01installed there. Right? In fact, I will
  277. 12:03show you. So what I will do is, I will
  278. 12:07just go over here and search for
  279. 12:10Anaconda. Right? So, here you will find
  280. 12:13the Anaconda Navigator. You need to
  281. 12:15start it. So guys, this is Anaconda
  282. 12:17Navigator on your screen. Right here,
  283. 12:20this is like the control panel of
  284. 12:22Anaconda. Right? Here you will see
  285. 12:25which softwares you have. If you want,
  286. 12:27you can add more applications. Like
  287. 12:29here, you can see we have Jupyter
  288. 12:31Notebook. We also have Spyder. We have
  289. 12:34the VS Code feature. RStudio too. And
  290. 12:37you can install these things as well.
  291. 12:40In fact, if you want to program in the
  292. 12:42R language for data science, you can
  293. 12:44install that too. Right? So, this is
  294. 12:47your main hub from where you control
  295. 12:49everything. Now, here under Home, there
  296. 12:51is an Environments tab. Now, the
  297. 12:53Environments tab, there are currently
  298. 12:55two environments on my machine. One is
  299. 12:57'base', which is created automatically
  300. 12:59as soon as you install it. And this
  301. 13:01second one, 'TensorFlow', I created for
  302. 13:03myself a few days ago because I was
  303. 13:04working on deep learning and needed to
  304. 13:06use my GPU. So, ignore this TensorFlow.
  305. 13:08On your machine, you will only see this
  306. 13:10base. Now, if you go to this base one,
  307. 13:13you will see all the libraries that are
  308. 13:15already installed. That is what I was
  309. 13:18telling you, that Anaconda pre-installs
  310. 13:20all the most useful or most commonly
  311. 13:23used data science libraries for you.
  312. 13:25That is why it becomes quite large, it
  313. 13:27is around a 450 MB installation. But
  314. 13:29there is a problem with this. If you
  315. 13:31work in the base environment, like when
  316. 13:33we started the Jupyter Notebook a while
  317. 13:35ago in this way, it actually opened the
  318. 13:37base one. You can also open it from
  319. 13:39here. Open with Jupyter Notebook, so
  320. 13:41the same thing would open, and you
  321. 13:43would get all the libraries
  322. 13:45pre-installed. But there is a problem
  323. 13:46with this approach. The problem is this
  324. 13:49: if, let's say, you have built a
  325. 13:51project and you want to deploy it to a
  326. 13:53server, the issue with that deployment
  327. 13:56is that all these libraries will also
  328. 13:58have to be installed on the server.
  329. 14:01Because the environment in which you
  330. 14:04created this project required all these
  331. 14:06libraries, the server will also demand
  332. 14:08those requirements and they will need
  333. 14:11to be installed. So, for no reason at
  334. 14:14all, your application will become very
  335. 14:17large in size. So, generally, what is
  336. 14:19done is that if you are working on a
  337. 14:21project, you create a new environment
  338. 14:23of your own. Okay? So, that is what I
  339. 14:25am going to show you: how we can create
  340. 14:27a new environment. And when you create
  341. 14:29that environment initially, there are
  342. 14:31no packages installed in it at the
  343. 14:33start. You freshly install only those
  344. 14:37packages that your project needs. And
  345. 14:40then, when you move that project to a
  346. 14:42server, only the libraries you
  347. 14:43installed in that environment are
  348. 14:45installed. So, you are kind of creating
  349. 14:47a safe box inside which you build your
  350. 14:49project and later deploy it to a
  351. 14:51website. Now, to be honest, if you
  352. 14:53don't even learn this concept of
  353. 14:54creating a virtual environment in the
  354. 14:56beginning, it's not a problem. You can
  355. 14:58get by. But if you ever want to deploy
  356. 15:01any project in the future, you will
  357. 15:03have to use virtual environments. I
  358. 15:05mean, you can do it without them too.
  359. 15:07But this is the right practice. So,
  360. 15:09since you are just starting out and we
  361. 15:11want to learn everything properly. I
  362. 15:13will cover this thing for you quickly
  363. 15:14as well. So, let me first show you how
  364. 15:16you can create a new environment. To be
  365. 15:19honest, you can even create it from the
  366. 15:20GUI. But I find this GUI a bit sluggish
  367. 15:23. I don't use their GUI. Like, there is
  368. 15:25a 'Create' option here. You can click
  369. 15:26here to create a new environment. Okay?
  370. 15:29But I will show you this using the
  371. 15:30command prompt. Okay? So, what you need
  372. 15:33to do is: You need to search for
  373. 15:34Anaconda, and you will find the
  374. 15:36Anaconda Prompt. You need to open it.
  375. 15:38This is the Anaconda Prompt, and this
  376. 15:40is the environment we are currently
  377. 15:41working in. The 'base' one. Okay? I can
  378. 15:44show you this one. We are currently in
  379. 15:46the 'base' one. Okay? Now, what do I
  380. 15:47need to do? Yeah. I need to create a
  381. 15:49new environment. So, for that, you have
  382. 15:51to type a command. You will have to
  383. 15:52write conda create hyphen hyphen name
  384. 15:55and the name of your new environment.
  385. 15:57All right? Let's say the name of my new
  386. 15:59environment is Campus X. I pressed
  387. 16:01enter, and in this step, you will be
  388. 16:03asked whether you would like to confirm
  389. 16:05or not. I said yes, and my environment
  390. 16:09was created. And look here, it says to
  391. 16:11activate this environment, use this
  392. 16:13command. Because we are still running
  393. 16:14in the base. All right? So what am I
  394. 16:16doing? I am activating my conda
  395. 16:18environment. So I would write conda
  396. 16:21activate and the name of my environment
  397. 16:24is Campus X; generally, you keep a name
  398. 16:28that is related to your project. All
  399. 16:30right? But since I am showing you right
  400. 16:32now, I kept it as Campus X. So you can
  401. 16:33see the name has changed here now. Now
  402. 16:35it is Campus X, so we are in a box
  403. 16:37inside which no libraries are installed
  404. 16:40yet. In fact, if I come back here, you
  405. 16:42can see an environment called Campus X
  406. 16:44has been created automatically. If I
  407. 16:46click on it, you can see that there are
  408. 16:48no libraries installed in the installed
  409. 16:50libraries section. All right? So at
  410. 16:52this point, if you click, you won't
  411. 16:54even get these options. Open with
  412. 16:56Jupyter Notebook, these options will
  413. 16:57not appear. The reason for that is that
  414. 16:59Jupyter Notebook is also a library
  415. 17:01which is not installed at all. So what
  416. 17:02do I have to do first? I will go back
  417. 17:05to Google Chrome and search for conda
  418. 17:09install jupyter notebook and I will
  419. 17:13have to copy this command. This is the
  420. 17:17command: conda install anaconda jupyter
  421. 17:19. I will copy this command, go back,
  422. 17:22and over here I will paste this command
  423. 17:25. I will just copy it one more time. It
  424. 17:30has been pasted. I pressed enter, and
  425. 17:33now what will happen is that this
  426. 17:35command will install Jupyter Notebook
  427. 17:37in my particular environment and also
  428. 17:39install its dependencies, and all of
  429. 17:42this is being downloaded. So it takes a
  430. 17:44little time. I will just wait. So you
  431. 17:46can see guys, we have completed all the
  432. 17:48installations. Now, if you want, you
  433. 17:51can type jupyter notebook from here and
  434. 17:54open Jupyter Notebook. All right? I
  435. 17:58pressed enter, and the Jupyter Notebook
  436. 18:00has opened, guys. All right? Now you
  437. 18:02will find the same files and folders
  438. 18:04here. But this time what can you do? If
  439. 18:06you create a new file, let's say And if
  440. 18:11you run commands here, this is actually
  441. 18:14running inside your own environment,
  442. 18:17which is Campus X. The problem with
  443. 18:20this environment right now is that your
  444. 18:23libraries aren't installed. See, NumPy
  445. 18:26isn't working. Okay? Because you
  446. 18:29haven't installed it. Now you have two
  447. 18:31options. Either you can go back, you
  448. 18:34can halt this machine right now by
  449. 18:36pressing Control C—not the machine,
  450. 18:39actually, just this script. And what
  451. 18:42can you do here? You can conda install
  452. 18:45NumPy. Okay? Like this. You will find
  453. 18:48this conda install command for every
  454. 18:50package. Okay? I typed yes. And now I
  455. 18:53am installing the first library that I
  456. 18:56need for my project. Similarly, you can
  457. 18:59install other libraries. I will also
  458. 19:01show you another way to install them.
  459. 19:03You won't need to keep going back here.
  460. 19:04Because to do this, you have to break
  461. 19:06the flow of the Jupyter Notebook. So
  462. 19:08you can see, now it says dead kernel.
  463. 19:12The kernel has died. So, see, it's
  464. 19:15installed. I will write jupyter again.
  465. 19:18Notebook, and I will start it. See, it
  466. 19:22has started again. I can go back to
  467. 19:26this. I just created this notebook, and
  468. 19:29now if I write import numpy here, Then
  469. 19:34it should work. See, now it is working.
  470. 19:37Okay? So, if you don't want to keep
  471. 19:39going back there to install, you can
  472. 19:40write the command directly here. Pip
  473. 19:42install, let's say NumPy—if you run
  474. 19:44this, you can install things into this
  475. 19:47environment from here too. Like it says
  476. 19:50here, requirement already satisfied,
  477. 19:51because we just installed it. Okay? So
  478. 19:54yeah, guys, this is it. Now if you want
  479. 19:59, you can also close this. You can
  480. 20:03close this environment. So I will press
  481. 20:05Control C, and if you want to
  482. 20:07deactivate, you just have to write this
  483. 20:09command: deactivate. Hit enter, and
  484. 20:11look, you are back in base. Okay? And
  485. 20:14if you go back to Anaconda Navigator
  486. 20:18and If you click on your CampusX
  487. 20:22environment again, you will see all the
  488. 20:24libraries you just installed there. So
  489. 20:27if I click on campX again, This UI is a
  490. 20:34bit sluggish. But you can see you will
  491. 20:37have NumPy here and its dependencies.
  492. 20:39See, there's NumPy, and you will also
  493. 20:41have Jupyter and its dependencies. See,
  494. 20:43these are all the Jupyter dependencies.
  495. 20:45Okay? So now, if you want, you can also
  496. 20:49add new libraries from here. If you go
  497. 20:53to "Not Installed," let's say you need
  498. 20:56Pandas, you search for Pandas, click on
  499. 20:59it, and click "Apply" from here. So,
  500. 21:02what will this do? It will
  501. 21:03automatically download Pandas. So, you
  502. 21:05have both options available. You can do
  503. 21:07it via the GUI, or you can do it via
  504. 21:08the command prompt. It's just that
  505. 21:10their command prompt—their GUI is a
  506. 21:12bit sluggish. So, I prefer using the
  507. 21:13command prompt. Okay? Now, let me
  508. 21:15quickly show you how you can delete
  509. 21:17this environment. Because generally,
  510. 21:18what happens? If you complete a project
  511. 21:20, you remove its environment from your
  512. 21:21machine afterwards. You push it to
  513. 21:23GitHub. Right? So, there are two ways.
  514. 21:24Either click on "Remove," or you can go
  515. 21:27to the command prompt and type this.
  516. 21:29You type ` conda remove--name campusx--
  517. 21:34all`. "All" means you are removing all
  518. 21:39dependencies, we are removing
  519. 21:42everything, and then press "Yes" and
  520. 21:47enter. These prompts are coming up, and
  521. 21:52after a while, if you notice, this
  522. 21:54thing will be gone. I will just wait.
  523. 21:56So you can see, we have removed
  524. 21:57everything. So at this point, if you
  525. 22:00type ` conda activate campusx`, it
  526. 22:03should give you—it didn't remove, I
  527. 22:06guess, or maybe it has. It takes a
  528. 22:09little time to update. As you can see
  529. 22:11here, it's gone. So first of all, I
  530. 22:14will deactivate, and now I will type
  531. 22:19here ` conda activate campusx`. I guess
  532. 22:25the folder hasn't been deleted. The
  533. 22:26folder created for campusx hasn't been
  534. 22:28deleted. But if you try to install
  535. 22:30anything, it shouldn't work. Let's see.
  536. 22:35Oh, it is working. That's strange. I
  537. 22:37guess I should close this and try again
  538. 22:40because it is taking some time. So I
  539. 22:44will just wait, and now I will run `
  540. 22:48conda` and here I would write ` conda
  541. 22:52activate campusx`—it keeps switching
  542. 22:56back. I don't know why...` conda
  543. 22:59install`—no, I think I need to
  544. 23:03restart once. You guys should try this
  545. 23:05out. It has been removed from here. It
  546. 23:08shouldn't have appeared there either,
  547. 23:09but somehow it is. So anyways, this was
  548. 23:12the whole concept of virtual
  549. 23:14environments. The whole idea is that
  550. 23:17you want to work on a new project in a
  551. 23:20completely blank, new setup. So that
  552. 23:22there are no issues on the server. That
  553. 23:24is the whole idea. Right? So that's
  554. 23:26done. Now, let me quickly tell you two
  555. 23:28more things. How to work on CG, how to
  556. 23:31work on Google Colab, and lastly, I'll
  557. 23:33show you a trick on how you can run CG
  558. 23:35data on Google Colab. Okay? Okay, now
  559. 23:38guys, I will show you where I
  560. 23:40personally work. A year or two ago, I
  561. 23:43used to work on Anaconda. Whenever I
  562. 23:47had a project—not actually a project,
  563. 23:49but in general, if I was working on
  564. 23:50something, teaching, or studying—I
  565. 23:52used to use Anaconda. But in the last
  566. 23:56couple of years, whenever I have any
  567. 23:58small task related to data science, I
  568. 24:01don't code on my local machine
  569. 24:03environment. Instead, I either use
  570. 24:06Kaggle or I use Google Colab. Okay? So,
  571. 24:10if you are a beginner and don't want to
  572. 24:12install Anaconda or anything, you can
  573. 24:15go directly to Kaggle. Because most of
  574. 24:18the time, the datasets you find are on
  575. 24:20Kaggle anyway. So, you just need to
  576. 24:24search for any dataset on Kaggle, like
  577. 24:27Titanic; and you just go there, like
  578. 24:30here you'll go to 'Code', and you'll
  579. 24:33see an option called 'New Notebook'.
  580. 24:37Whenever you visit any dataset, you
  581. 24:38will see the 'New Notebook' option. For
  582. 24:40instance, let's say I'm going to
  583. 24:42Twitter. So, after searching a lot,
  584. 24:45datasets appeared, and let's say I
  585. 24:47entered this dataset. And now, what do
  586. 24:49I need to do? I need to code something
  587. 24:51related to this. So, I will click on '
  588. 24:54New Notebook'. What will this do? It
  589. 24:56will create a notebook in Kaggle too. A
  590. 24:59Jupyter notebook. Okay? This is the
  591. 25:01Jupyter notebook. I can rename it from
  592. 25:05here. I can write anything. 'Test Run',
  593. 25:09and that's it. It is exactly the same
  594. 25:12thing. Look here, you have two options:
  595. 25:14'Code' and 'Markdown'. If you need the
  596. 25:16dataset, you just need to run this
  597. 25:18first cell. This first cell will give
  598. 25:20you the file path. Like this is your
  599. 25:22CSV file path. And along with it, it
  600. 25:24will also import NumPy and Pandas for
  601. 25:26you. Here, you can simply write `
  602. 25:28pd.read_csv`. And here, you can paste
  603. 25:33the path and run it. And look here,
  604. 25:36guys, your dataset has appeared. Okay?
  605. 25:38You can store this in a variable. And
  606. 25:41you can do all those things here as
  607. 25:43well. Like markdown, if you want to
  608. 25:45write something, uh...Hello World. Okay
  609. 25:49? If you want to make it bold. To bold
  610. 25:52it in markdown, you use a combination
  611. 25:54of two asterisks. See, and you can do
  612. 25:57everything here that you were able to
  613. 26:00do on your machine using Anaconda,
  614. 26:02right here in Kaggle. So personally,
  615. 26:06most of the time what I do is search
  616. 26:08for datasets on Kaggle and run them
  617. 26:11right here. It saves a lot of time. If
  618. 26:13you want, you can share it with others
  619. 26:15immediately. You just have to make it
  620. 26:17public. Okay? And secondly, you have to
  621. 26:21save it. You can save it. And as soon
  622. 26:25as you save it, it becomes visible to
  623. 26:27other people on Kaggle. So if you get
  624. 26:29upvotes on Kaggle, it also enhances
  625. 26:31your profile on Kaggle. That's why I
  626. 26:34prefer writing these kinds of codes in
  627. 26:36Kaggle, but if you are working on
  628. 26:38projects, obviously you won't use
  629. 26:39Kaggle. Okay? Second, if you have your
  630. 26:44own dataset and you want to upload it,
  631. 26:47you can go here and what you can do is
  632. 26:50go into input and, uh...Actually, I
  633. 26:55don't remember. Plus, I guess I used it
  634. 26:59somewhere. Yes, add data, from here I
  635. 27:03can use my own personal dataset. See,
  636. 27:06upload a dataset, browse files, and
  637. 27:08like I have a dataset called cars on my
  638. 27:11machine. Let's give it a data name,
  639. 27:15cars. .csv or cars123, it needs some
  640. 27:23unique URL, and I created it. See, it
  641. 27:29says we are processing your data, it's
  642. 27:32processed and...Now if you run this,
  643. 27:39see, it is here, if I run this again,
  644. 27:42then I have the cars one too. So I can
  645. 27:45copy this path and I will paste it over
  646. 27:49here like this. And if I run it now and
  647. 27:53write df here, then here is my entire
  648. 27:56car data. Okay? So even if your data is
  649. 27:59not available on Kaggle, but you want
  650. 28:02to use this Kaggle interface, this UI,
  651. 28:05you can do so by uploading data this
  652. 28:07way. Okay! Another good thing is that
  653. 28:10you can download it from here. Okay, so
  654. 28:13I'm doing this notebook like this. See,
  655. 28:15it ran and it downloaded. Now, if you
  656. 28:18want, you can upload it to Git, keep it
  657. 28:19on your machine, or share it with
  658. 28:21someone—it's up to you. Okay, here,
  659. 28:23if you generate something—anything
  660. 28:25you generate—how is it generated?
  661. 28:29Let's say I want to generate this DF as
  662. 28:31an output. So, I can do that too. I can
  663. 28:35write ` df.to_csv`, file name `
  664. 28:37cars.csv`, and run it. If I go to
  665. 28:41output and refresh, see, the CSV is
  666. 28:44here, and I can download it from here,
  667. 28:47and it will download. So, during
  668. 28:52execution, if you are generating
  669. 28:53something you need, it can be any file,
  670. 28:55and you can download it this way. Right
  671. 28:58? So, the Kaggle interface is really
  672. 29:00great. The only problem is that you
  673. 29:02don't have a GPU, a graphics card, here
  674. 29:05. So, if you are working in deep
  675. 29:07learning, the execution will be very
  676. 29:10slow here, and the solution to that is
  677. 29:12Google Colab, which we will study next.
  678. 29:15So, another tool we have is Google
  679. 29:17Colab. It belongs to Google. Obviously,
  680. 29:20everything is the same. There is just
  681. 29:22one advantage to it. Actually, there
  682. 29:23are two advantages. The first advantage
  683. 29:25is that this tool is directly linked to
  684. 29:28your Drive account. So, whatever you
  685. 29:30code is automatically saved in your
  686. 29:32Drive account. Like, I have all these
  687. 29:34notebooks saved here. Right? If you
  688. 29:36want, you can create a new notebook.
  689. 29:39Which, again, is just a Jupyter
  690. 29:41notebook. There is nothing particularly
  691. 29:42different. This is just an online
  692. 29:43version of a Jupyter notebook,
  693. 29:44everything. Either in Kaggle or in
  694. 29:46Google Colab. See, here if you want,
  695. 29:49you can rename it "Test Run," and you
  696. 29:51have the same options for code and text
  697. 29:54; exactly the features you had, you run
  698. 29:57it here just the same by hitting Shift
  699. 30:00+ Enter to get the output. The second
  700. 30:04benefit of using Google Colab is that
  701. 30:05you have the power of a GPU here. So,
  702. 30:09if you are studying deep learning
  703. 30:11alongside and don't have a very good
  704. 30:13machine—let's say you don't have a
  705. 30:15machine with a great graphics card—
  706. 30:17you can use Google Colab. Right? Here
  707. 30:20you go to Runtime, where did it go? I
  708. 30:23keep forgetting the settings. And by
  709. 30:25going to Change Runtime Type, you can
  710. 30:28select GPU under Hardware Accelerator.
  711. 30:31Okay? Like this. Now, your deep
  712. 30:33learning code—obviously, your machine
  713. 30:35learning code won't use the GPU. Your
  714. 30:38deep learning code runs much faster
  715. 30:40compared to the CPU. Okay? In fact, you
  716. 30:43can use TPU here as well. If your code
  717. 30:45libraries support TPU, your code will
  718. 30:48run even faster. The only issue here is
  719. 30:50that you don't have datasets directly
  720. 30:52like on Kaggle. So, you have to upload
  721. 30:54the datasets. Okay? How do you upload?
  722. 30:56It's very simple. Ran it. Here is the
  723. 30:59cars dataset, and it is uploaded. I
  724. 31:02just need to copy its path. And here, I
  725. 31:05will have to import pandas as pd; all
  726. 31:08these libraries are pre-installed. As
  727. 31:11we have seen so far, in pandas, I would
  728. 31:14write pd.read_csv. And here, I will
  729. 31:19just paste the path, and now if I run
  730. 31:21the df, I will get the same. Okay? So,
  731. 31:24if you have any dataset on your machine
  732. 31:26, you can bring it here directly. Okay?
  733. 31:28All the features are available here for
  734. 31:30you as well. You can go to File and
  735. 31:32download it. Where did the download
  736. 31:35option go? There it is; you can
  737. 31:37download it as a Python file or in
  738. 31:39Jupyter Notebook format. Okay? You have
  739. 31:42GPU support. All these files are
  740. 31:44automatically being saved to your Drive
  741. 31:45. So, Google Colab is also a great
  742. 31:48option. So, either I use Google Colab
  743. 31:51or I use Kaggle. As long as I am not
  744. 31:53building a project, I work on these two
  745. 31:55, and I have never faced any issues as
  746. 31:57such. Okay? So, now I will tell you one
  747. 31:59last thing in this video. After that,
  748. 32:01we will close this video. That is, if
  749. 32:04you are working in deep learning and
  750. 32:06let's say you don't have a machine with
  751. 32:08a great GPU, then obviously you will
  752. 32:11try to use Google Colab. But in Google
  753. 32:13Colab, you have to upload the dataset.
  754. 32:15Right? Now, the datasets that you will
  755. 32:17mostly find will be on Kaggle. All the
  756. 32:20great datasets you find related to
  757. 32:22image processing, like those very large
  758. 32:24datasets. For example, there is a mask
  759. 32:27detection dataset. See, now take this
  760. 32:30dataset for example. Like, this is the
  761. 32:34dataset. There are also very large
  762. 32:36datasets. Like, what will I do with 23
  763. 32:37GB? Let's go with the 2GB one, I'll
  764. 32:39show you. This is the 2GB dataset.
  765. 32:41Right? Uh, these are CSV files. Yes,
  766. 32:45this is the dataset. It will contain
  767. 32:47all the images. Here are all the images
  768. 32:51. Right? These are all the images. Now,
  769. 32:53what do I have to do? If I'm using
  770. 32:56Google Colab, I would have to download
  771. 32:57all these images and then upload them
  772. 32:59here. Right? Which is a very hectic
  773. 33:02task. You won't be able to do that. So,
  774. 33:04I will tell you a quick trick so that
  775. 33:06you can bring any Kaggle dataset, no
  776. 33:09matter how big, directly here and work
  777. 33:12on it. The benefit is that you have the
  778. 33:15power of Google Colab's GPU and the
  779. 33:18Kaggle dataset. In short, you won't
  780. 33:20need to buy a very expensive computer
  781. 33:23for deep learning. You can manage your
  782. 33:25work in Google Colab. Yes, it's a
  783. 33:26different story if you are building
  784. 33:28projects, then it gets a bit difficult.
  785. 33:30But if you are just in the process of
  786. 33:32learning, this will easily solve your
  787. 33:34purpose. Right? So, we will see this
  788. 33:36next. Okay guys. So let's start. Uh,
  789. 33:38what do we have to do? We need to bring
  790. 33:41this dataset from Kaggle to this place
  791. 33:44here. Right? So first of all, what do
  792. 33:48you have to do, guys? You have to go to
  793. 33:50your account on Kaggle. That is step
  794. 33:53one. You will go to your account and
  795. 33:55from there you have to download an API
  796. 33:58token. See, you have to create a new
  797. 34:00API token. So once you click on this, a
  798. 34:04file will automatically download to
  799. 34:06your machine. What you just have to do
  800. 34:09is, go here and upload this file. Right
  801. 34:11? Uh, Kaggle. See, this is the file. So
  802. 34:17yeah guys, our file has been uploaded.
  803. 34:19Now what do we have to do? We have to
  804. 34:22copy these two lines of code and run
  805. 34:24them here. Basically, we are creating a
  806. 34:26directory called Kaggle and copying/
  807. 34:28pasting into it. Right? This file,
  808. 34:30kaggle.json. So if I run this, you
  809. 34:32won't see any output. But this step is
  810. 34:34important. Right? After that, what do
  811. 34:36you have to do? Whatever dataset you
  812. 34:39want to use, go to its page, click here
  813. 34:42, select copy API command, and paste
  814. 34:45that API command here. Just make sure
  815. 34:49to add an exclamation mark before it
  816. 34:51because it is a command. Okay? Now, as
  817. 34:53soon as you run this, the data will be
  818. 34:56downloaded into this Colab folder. Okay
  819. 35:00? So you can see it's very fast. It's
  820. 35:01downloading at around 100, more than
  821. 35:04100 Mbps. So this data will be
  822. 35:06downloaded and arrive here very quickly
  823. 35:07. Okay? If you try to do this manually,
  824. 35:09it takes a lot of time. Because first
  825. 35:11you download 2GB then you upload 2GB,
  826. 35:13and with small files, it would take a
  827. 35:15lot of time. Here, you can see how fast
  828. 35:17it was. Right? If I refresh this. So
  829. 35:20you can see, here is my data. Okay? The
  830. 35:22only problem with this data is that it
  831. 35:24is in zip format. And what will you
  832. 35:26need? Each file separated. So there is
  833. 35:28a custom code for that too. You have a
  834. 35:30module called zipfile. You just have to
  835. 35:32paste this code here. Where you just
  836. 35:35need to put the file name in this spot.
  837. 35:37Okay? That's it. And now as soon as you
  838. 35:39run this, what will it do? It will
  839. 35:41unzip this entire zip file right here
  840. 35:43and extract all the files. It might
  841. 35:46take a little time. And guys, this step
  842. 35:48is done. If I refresh it again. So you
  843. 35:50can see, here is our medical mask data.
  844. 35:52If I click on it. Here is that folder.
  845. 35:54Here is that folder. And here are all
  846. 35:57the images. It takes a little time. See
  847. 36:02, these are all the images. Now you can
  848. 36:05use libraries like Keras to use them
  849. 36:07immediately. But that is not our
  850. 36:09concern. I just wanted to show you how
  851. 36:11you can bring and import very large
  852. 36:13datasets into Google Colab. And why
  853. 36:15were we doing this? Because I have the
  854. 36:17power of a GPU here. So even if I don't
  855. 36:19have a powerful machine myself, I can
  856. 36:22always use Google Colab. Okay? So yeah,
  857. 36:25guys. I have explained many things to
  858. 36:30you in this video. Trust me, it took me
  859. 36:32a long time to learn all these things
  860. 36:34or solve these problems. So that's why
  861. 36:36I thought I would teach you all of this
  862. 36:38in a single video. So that it can serve
  863. 36:40as a reference for you. In the future,
  864. 36:42if you are ever trying any of these
  865. 36:43things, even when you move into deep
  866. 36:45learning, you can refer back to this
  867. 36:46video. You likely won't face any more
  868. 36:48issues related to tools in machine
  869. 36:50learning. Okay? So yeah, that's it for
  870. 36:53today. Tomorrow, we will look at an
  871. 36:55end-to-end machine learning project
  872. 36:57example to get a bird's-eye view. So
  873. 36:59yeah, if you liked this video guys,
  874. 37:01please consider subscribing and do
  875. 37:02share it too. So yeah, see you tomorrow
  876. 37:05.

About this transcript

This page contains the full transcript of Installing Anaconda For Data Science | Jupyter Notebook for Machine Learning | Google Colab for ML by CampusX, generated from the public captions YouTube serves with the video. The transcript has 6,301 words across 876 segments, with the original timestamps preserved so you can click any line to jump to that moment in the embedded player.

What you can do with it

Use the transcript to take notes, quote the speaker, build a study guide, generate a summary with ChatGPT or Claude via the YouTube Summary tool, or export it as a timed subtitle file with YouTube to SRT. You can also re-open it in the transcriber to choose a caption track available on the video.

Free YouTube transcript tool

YouTube2Text is a free YouTube transcript generator — no signup, no daily limit. Paste any YouTube link and get the full transcript instantly, with timestamps, click-to-jump, caption language selection, AI prompts for ChatGPT, Claude, and Gemini, and exports to TXT, SRT, VTT, or Markdown.