Installing Anaconda For Data Science | Jupyter Notebook for Machine Learning | Google Colab for ML — Transcript
Full transcript
- 0:00Hello guys, welcome to my YouTube
- 0:01channel. This is 100 Days of Machine
- 0:03Learning and today is day 12. I guess
- 0:06yeah, it is day 12. So we have studied
- 0:09quite a lot and since the last video,
- 0:10we have started practical machine
- 0:12learning. And I had planned to show you
- 0:16an end-to-end machine learning project
- 0:18in this video. But before that, I felt
- 0:22I should quickly teach you how to
- 0:25install all the tools. Right? So in
- 0:28this video, I will discuss the three
- 0:32most famous tools used in machine
- 0:36learning among all the ways to work. So
- 0:40after this video, you shouldn't have
- 0:43any problems using any of these tools.
- 0:45Right? That is the whole idea of this
- 0:47video. So we will discuss these six
- 0:50things in this video. First, we will
- 0:52install software named Anaconda. So if
- 0:56you want to do machine learning on
- 0:58Windows or other operating systems,
- 1:01Anaconda is the best platform right now
- 1:04. It is the best software. Because what
- 1:07Anaconda does is, it handles all the
- 1:09data science packages you will use. See
- 1:11, in data science, you have to use a
- 1:13lot of packages and libraries. So
- 1:15installing them all by yourself could
- 1:16be hectic. So Anaconda provides you
- 1:19with all the installations in one place
- 1:21. And then what can you do? You can
- 1:23start your work directly. So that is
- 1:25the whole idea behind Anaconda. And at
- 1:27this point, it is the most popular data
- 1:30science platform. Let me show you. So
- 1:33if you Google Anaconda, this is the
- 1:36website. They have even written "the
- 1:39most popular data science platform."
- 1:42You just need to go there, go to
- 1:44products, and download the individual
- 1:46edition. See, I clicked on download.
- 1:52You need to select your operating
- 1:53system. In my case, it is 64-bit
- 1:55Windows. And that's it, guys. You just
- 2:01need to download it. It is a slightly
- 2:04large software. It would take around
- 2:07450 MB, it is a bit large. But yeah,
- 2:11you have to download it and then
- 2:13install it. I will just pause this
- 2:15video. So yeah, as you can see, it is
- 2:17downloaded. Now you just need to
- 2:18install it, and the installation is
- 2:20very simple. You just have to click
- 2:22next, next, next, and finish. Uh. See,
- 2:26keep everything at default. In my case,
- 2:29this software is already installed. So
- 2:31I am not installing this again. But you
- 2:33just simply have to install it with
- 2:36custom settings. That's it. Okay? So I
- 2:38will cancel the installation. And I
- 2:40will tell you what to do after this. So
- 2:42Anaconda is installed for us. Now in
- 2:45Anaconda, you have multiple things that
- 2:47you can work on. Like one is Spyder. So
- 2:50Spyder is one of the tools that comes
- 2:53with Anaconda using which you can
- 2:55directly run machine learning or Python
- 2:58codes. Okay? I will just let it open.
- 3:03Here it is. Okay? Here, what you can do
- 3:06is you can directly run machine
- 3:08learning related code. Many people
- 3:11prefer Anaconda. Although I don't
- 3:14really, I'm sorry, many people prefer
- 3:16Spyder. But I am not one of those. I
- 3:20like another tool more. You can see
- 3:23this entire interface is very simple.
- 3:24The advantage of this particular
- 3:27interface is that this tool can display
- 3:29your data and such very well. Okay? But
- 3:33I don't prefer it. I mean, it is up to
- 3:35you. If you want, you can use Spyder.
- 3:37But I personally use Jupyter. Okay,
- 3:40which I feel is even more famous. You
- 3:43have to search for Jupyter Notebook
- 3:45once you have installed it, and once
- 3:48you open it, a black console will
- 3:50appear first and after that, you will
- 3:52see this window in your browser and you
- 3:55work from here. Okay? So let me show
- 3:58you how we are doing this work. What I
- 4:00will do is I will just minimize this
- 4:02window and see, what do you have to do?
- 4:06First of all, whenever you are starting
- 4:08a project, you create a new folder.
- 4:11Okay? Now you cannot see if anything
- 4:13happened or not. But if you go down, an
- 4:15untitled folder has been created here.
- 4:17I am checking this and I am renaming it
- 4:21. As "100 Days of ML," and now this
- 4:26folder of mine has been renamed. Now I
- 4:30went inside it and there is nothing
- 4:32here right now. Okay? Now what you can
- 4:34do here is you can create a new Python
- 4:38notebook. Okay? Notebook means Jupyter
- 4:40Notebook. So if you create a Python 3
- 4:43notebook here, then you will get
- 4:45something like this. This is what we
- 4:47call Jupyter Notebook. It is a very
- 4:50powerful and very useful tool. This is
- 4:52the reason why I don't prefer Spyder.
- 4:54Instead, I love using Jupyter Notebook.
- 4:57Because here you get a notebook-like
- 4:59interface. Okay? Now, what can you do
- 5:01here? You can do two things here.
- 5:04Either you can run your Python code.
- 5:07When code mode is selected here, you
- 5:10can run code in Python. Like this. I
- 5:14pressed Shift-Enter here and I got the
- 5:16output. If you press Enter here, you
- 5:18will go to the next line. You have to
- 5:20press Shift-Enter. And if you want, you
- 5:23can write Markdown here. So what is
- 5:25Markdown? Markdown is a way of writing
- 5:27text. Okay? Like let's say you want to
- 5:30create a sort of notebook for yourself.
- 5:32Like you are covering the first topic,
- 5:35uh, import data set. Okay? Import data
- 5:41set. And as soon as you hit Enter. Oh
- 5:43oh sorry, I need to select Markdown
- 5:46here, see. And now I ran it. You can
- 5:49see here a really cool, kind of textual
- 5:53, a nice web page has been created.
- 5:56Right? If I select Markdown again here
- 5:59and what can I do here? I can simply
- 6:02write something like, uh, over here. We
- 6:08will import the data set. Okay? And the
- 6:12text will appear here like this. Okay?
- 6:14So if you want to run code, you have to
- 6:16select code here. If you want to add
- 6:18this kind of text in between your
- 6:20notebook, then you have to select
- 6:21Markdown. Okay? You can also select
- 6:23headings. But to be honest, you can do
- 6:24headings using Markdown as well. If
- 6:27your Markdown is selected, then if you
- 6:29add a single hash, it will become your
- 6:32first-level heading. If you add two
- 6:36hashes, it will become a slightly
- 6:39smaller sub-heading. I hope you are
- 6:42understanding this thing. Okay? If you
- 6:44write normally, it will appear as a
- 6:45paragraph. If you want, you can also
- 6:47write HTML here. Okay? If you want, you
- 6:49can also write HTML here if you know
- 6:51HTML. Okay? If I write hello here and
- 6:55here I write style equals color red,
- 7:00see, it came in red color. Okay? So
- 7:04this means that you can add videos here
- 7:06. If you want, you can add images here,
- 7:10and I have seen people use this feature
- 7:12very well to create great notebooks.
- 7:16And you will find many such notebooks
- 7:18at the gate. Right? So, this is the
- 7:20best part about Jupyter Notebook that I
- 7:22personally love. First of all, you can
- 7:25run your code cell by cell. That is the
- 7:28best thing. Then you can write a lot of
- 7:30markdown to describe it. Right? Apart
- 7:33from this, there are many other
- 7:34features here too. You can add
- 7:36interactive widgets if you want. Right?
- 7:39If you want, well, I will teach you in
- 7:42another video how to add widgets for
- 7:45user interaction. Like you can add
- 7:49buttons, range sliders, or form fields.
- 7:53So, you can do a lot of things like
- 7:54this in your Jupyter Notebook. In short
- 7:56, it is a very powerful tool. And
- 7:58nowadays, people working in data
- 8:01science prefer Jupyter Notebook a lot.
- 8:03They like it very much. And by writing
- 8:06in this, a good culture of knowledge
- 8:08sharing has been set up among people.
- 8:11Right? So, what I would suggest is that
- 8:13if you are seeing all this for the
- 8:15first time, go ahead and use this tool
- 8:17without fear. Right? There are many
- 8:19other options here as well. Like
- 8:20running, shutting down the kernel, or
- 8:24adding new cells. Right? Right? There
- 8:27are many different features. I am not
- 8:28going into the basics because this
- 8:30video is not about Jupyter Notebook.
- 8:32This video is about setting up your
- 8:34tools. Right? I will quickly show you
- 8:37one thing, let's say you want to import
- 8:40a dataset. How would you do that? Right
- 8:43? So 99%of the time, the datasets you
- 8:46get will be from Kaggle. Right? So I
- 8:48will go to Kaggle and I will just
- 8:50download a dataset. I will download any
- 8:53one dataset. Uh Let's say this one. I
- 8:57am downloading this dataset. It is a 2
- 8:59MB dataset. This is the dataset. Called
- 9:03age train. Now I have downloaded it.
- 9:06Obviously, to download, you will first
- 9:08have to log in to Kaggle. And it's done
- 9:12. And now what do I have to do? I am
- 9:14extracting it to the desktop. So you
- 9:20can see at this point, my dataset is on
- 9:22the desktop. Right? Now what do I have
- 9:24to do? First of all, I will go back to
- 9:27this folder that I just created, 100
- 9:29Days of ML. Now, I will click on upload
- 9:32here. And from here, I will go to the
- 9:35desktop, select this dataset, and open
- 9:38it. An upload option will appear here.
- 9:40And look, it has been uploaded here. So
- 9:42, that is how you upload datasets to
- 9:44your folder. Now, if you want to see
- 9:47how this dataset looks, it appears like
- 9:49this. Okay? But if you want to bring it
- 9:52into your Jupyter notebook, you will
- 9:54need to learn a bit of Pandas. At this
- 9:57point, I would suggest that you learn
- 10:00NumPy and Pandas. Playlists for both
- 10:03are available on my channel. I will add
- 10:05the links to both playlists in the
- 10:07description of this video. This weekend
- 10:10, if you want, you can quickly learn
- 10:12Pandas and NumPy; meanwhile, I will
- 10:14quickly show you how to import Pandas
- 10:17to bring that dataset here. So what you
- 10:21do is just write pd dot, there is a
- 10:24function called read_csv, and since
- 10:27both files are in the same folder, I
- 10:30will just copy the name of this file
- 10:33like this, run it, and here is our data
- 10:36, guys. Okay? So there are 19,000 rows
- 10:39and 14 columns, and if I want, I can
- 10:42store this in a variable. Generally, we
- 10:44call this variable 'df'. 'df' stands
- 10:46for DataFrame, which is a Pandas object
- 10:48. So, yeah, okay? So, that is how you
- 10:51use Anaconda and Jupyter. Now, there
- 10:54are many small tips and tricks here
- 10:56that I have learned slowly over the
- 10:58years. You can also learn by
- 10:59experimenting if you want. But I have
- 11:01taught you all the basics you need. Now
- 11:03, let's say you want to download this
- 11:05notebook, you can download it as well.
- 11:07Okay? You can download it in any format
- 11:09. As Python, as HTML, as PDF, or if you
- 11:13want, as an ipynb notebook, which is
- 11:15the format it is in, and after
- 11:17downloading, you can easily upload it
- 11:20to your GitHub account. Okay? So,
- 11:23that's it. This was the first part we
- 11:25needed to cover in this video. First,
- 11:28how to install Anaconda. And second, to
- 11:31give you a brief introduction to
- 11:32Jupyter Notebook. Okay? Now, I will
- 11:34teach you something new, which is how
- 11:36to create a virtual environment. And I
- 11:38will also tell you why creating a
- 11:40virtual environment is important. Okay?
- 11:42So now, guys, let's discuss what a
- 11:44virtual environment is. Okay? So, if
- 11:47you normally go to your Start menu and
- 11:50search for Jupyter to start it, what
- 11:53happens is that it uses a common
- 11:55installation. From where Jupyter is
- 11:58running. All the libraries are already
- 12:01installed there. Right? In fact, I will
- 12:03show you. So what I will do is, I will
- 12:07just go over here and search for
- 12:10Anaconda. Right? So, here you will find
- 12:13the Anaconda Navigator. You need to
- 12:15start it. So guys, this is Anaconda
- 12:17Navigator on your screen. Right here,
- 12:20this is like the control panel of
- 12:22Anaconda. Right? Here you will see
- 12:25which softwares you have. If you want,
- 12:27you can add more applications. Like
- 12:29here, you can see we have Jupyter
- 12:31Notebook. We also have Spyder. We have
- 12:34the VS Code feature. RStudio too. And
- 12:37you can install these things as well.
- 12:40In fact, if you want to program in the
- 12:42R language for data science, you can
- 12:44install that too. Right? So, this is
- 12:47your main hub from where you control
- 12:49everything. Now, here under Home, there
- 12:51is an Environments tab. Now, the
- 12:53Environments tab, there are currently
- 12:55two environments on my machine. One is
- 12:57'base', which is created automatically
- 12:59as soon as you install it. And this
- 13:01second one, 'TensorFlow', I created for
- 13:03myself a few days ago because I was
- 13:04working on deep learning and needed to
- 13:06use my GPU. So, ignore this TensorFlow.
- 13:08On your machine, you will only see this
- 13:10base. Now, if you go to this base one,
- 13:13you will see all the libraries that are
- 13:15already installed. That is what I was
- 13:18telling you, that Anaconda pre-installs
- 13:20all the most useful or most commonly
- 13:23used data science libraries for you.
- 13:25That is why it becomes quite large, it
- 13:27is around a 450 MB installation. But
- 13:29there is a problem with this. If you
- 13:31work in the base environment, like when
- 13:33we started the Jupyter Notebook a while
- 13:35ago in this way, it actually opened the
- 13:37base one. You can also open it from
- 13:39here. Open with Jupyter Notebook, so
- 13:41the same thing would open, and you
- 13:43would get all the libraries
- 13:45pre-installed. But there is a problem
- 13:46with this approach. The problem is this
- 13:49: if, let's say, you have built a
- 13:51project and you want to deploy it to a
- 13:53server, the issue with that deployment
- 13:56is that all these libraries will also
- 13:58have to be installed on the server.
- 14:01Because the environment in which you
- 14:04created this project required all these
- 14:06libraries, the server will also demand
- 14:08those requirements and they will need
- 14:11to be installed. So, for no reason at
- 14:14all, your application will become very
- 14:17large in size. So, generally, what is
- 14:19done is that if you are working on a
- 14:21project, you create a new environment
- 14:23of your own. Okay? So, that is what I
- 14:25am going to show you: how we can create
- 14:27a new environment. And when you create
- 14:29that environment initially, there are
- 14:31no packages installed in it at the
- 14:33start. You freshly install only those
- 14:37packages that your project needs. And
- 14:40then, when you move that project to a
- 14:42server, only the libraries you
- 14:43installed in that environment are
- 14:45installed. So, you are kind of creating
- 14:47a safe box inside which you build your
- 14:49project and later deploy it to a
- 14:51website. Now, to be honest, if you
- 14:53don't even learn this concept of
- 14:54creating a virtual environment in the
- 14:56beginning, it's not a problem. You can
- 14:58get by. But if you ever want to deploy
- 15:01any project in the future, you will
- 15:03have to use virtual environments. I
- 15:05mean, you can do it without them too.
- 15:07But this is the right practice. So,
- 15:09since you are just starting out and we
- 15:11want to learn everything properly. I
- 15:13will cover this thing for you quickly
- 15:14as well. So, let me first show you how
- 15:16you can create a new environment. To be
- 15:19honest, you can even create it from the
- 15:20GUI. But I find this GUI a bit sluggish
- 15:23. I don't use their GUI. Like, there is
- 15:25a 'Create' option here. You can click
- 15:26here to create a new environment. Okay?
- 15:29But I will show you this using the
- 15:30command prompt. Okay? So, what you need
- 15:33to do is: You need to search for
- 15:34Anaconda, and you will find the
- 15:36Anaconda Prompt. You need to open it.
- 15:38This is the Anaconda Prompt, and this
- 15:40is the environment we are currently
- 15:41working in. The 'base' one. Okay? I can
- 15:44show you this one. We are currently in
- 15:46the 'base' one. Okay? Now, what do I
- 15:47need to do? Yeah. I need to create a
- 15:49new environment. So, for that, you have
- 15:51to type a command. You will have to
- 15:52write conda create hyphen hyphen name
- 15:55and the name of your new environment.
- 15:57All right? Let's say the name of my new
- 15:59environment is Campus X. I pressed
- 16:01enter, and in this step, you will be
- 16:03asked whether you would like to confirm
- 16:05or not. I said yes, and my environment
- 16:09was created. And look here, it says to
- 16:11activate this environment, use this
- 16:13command. Because we are still running
- 16:14in the base. All right? So what am I
- 16:16doing? I am activating my conda
- 16:18environment. So I would write conda
- 16:21activate and the name of my environment
- 16:24is Campus X; generally, you keep a name
- 16:28that is related to your project. All
- 16:30right? But since I am showing you right
- 16:32now, I kept it as Campus X. So you can
- 16:33see the name has changed here now. Now
- 16:35it is Campus X, so we are in a box
- 16:37inside which no libraries are installed
- 16:40yet. In fact, if I come back here, you
- 16:42can see an environment called Campus X
- 16:44has been created automatically. If I
- 16:46click on it, you can see that there are
- 16:48no libraries installed in the installed
- 16:50libraries section. All right? So at
- 16:52this point, if you click, you won't
- 16:54even get these options. Open with
- 16:56Jupyter Notebook, these options will
- 16:57not appear. The reason for that is that
- 16:59Jupyter Notebook is also a library
- 17:01which is not installed at all. So what
- 17:02do I have to do first? I will go back
- 17:05to Google Chrome and search for conda
- 17:09install jupyter notebook and I will
- 17:13have to copy this command. This is the
- 17:17command: conda install anaconda jupyter
- 17:19. I will copy this command, go back,
- 17:22and over here I will paste this command
- 17:25. I will just copy it one more time. It
- 17:30has been pasted. I pressed enter, and
- 17:33now what will happen is that this
- 17:35command will install Jupyter Notebook
- 17:37in my particular environment and also
- 17:39install its dependencies, and all of
- 17:42this is being downloaded. So it takes a
- 17:44little time. I will just wait. So you
- 17:46can see guys, we have completed all the
- 17:48installations. Now, if you want, you
- 17:51can type jupyter notebook from here and
- 17:54open Jupyter Notebook. All right? I
- 17:58pressed enter, and the Jupyter Notebook
- 18:00has opened, guys. All right? Now you
- 18:02will find the same files and folders
- 18:04here. But this time what can you do? If
- 18:06you create a new file, let's say And if
- 18:11you run commands here, this is actually
- 18:14running inside your own environment,
- 18:17which is Campus X. The problem with
- 18:20this environment right now is that your
- 18:23libraries aren't installed. See, NumPy
- 18:26isn't working. Okay? Because you
- 18:29haven't installed it. Now you have two
- 18:31options. Either you can go back, you
- 18:34can halt this machine right now by
- 18:36pressing Control C—not the machine,
- 18:39actually, just this script. And what
- 18:42can you do here? You can conda install
- 18:45NumPy. Okay? Like this. You will find
- 18:48this conda install command for every
- 18:50package. Okay? I typed yes. And now I
- 18:53am installing the first library that I
- 18:56need for my project. Similarly, you can
- 18:59install other libraries. I will also
- 19:01show you another way to install them.
- 19:03You won't need to keep going back here.
- 19:04Because to do this, you have to break
- 19:06the flow of the Jupyter Notebook. So
- 19:08you can see, now it says dead kernel.
- 19:12The kernel has died. So, see, it's
- 19:15installed. I will write jupyter again.
- 19:18Notebook, and I will start it. See, it
- 19:22has started again. I can go back to
- 19:26this. I just created this notebook, and
- 19:29now if I write import numpy here, Then
- 19:34it should work. See, now it is working.
- 19:37Okay? So, if you don't want to keep
- 19:39going back there to install, you can
- 19:40write the command directly here. Pip
- 19:42install, let's say NumPy—if you run
- 19:44this, you can install things into this
- 19:47environment from here too. Like it says
- 19:50here, requirement already satisfied,
- 19:51because we just installed it. Okay? So
- 19:54yeah, guys, this is it. Now if you want
- 19:59, you can also close this. You can
- 20:03close this environment. So I will press
- 20:05Control C, and if you want to
- 20:07deactivate, you just have to write this
- 20:09command: deactivate. Hit enter, and
- 20:11look, you are back in base. Okay? And
- 20:14if you go back to Anaconda Navigator
- 20:18and If you click on your CampusX
- 20:22environment again, you will see all the
- 20:24libraries you just installed there. So
- 20:27if I click on campX again, This UI is a
- 20:34bit sluggish. But you can see you will
- 20:37have NumPy here and its dependencies.
- 20:39See, there's NumPy, and you will also
- 20:41have Jupyter and its dependencies. See,
- 20:43these are all the Jupyter dependencies.
- 20:45Okay? So now, if you want, you can also
- 20:49add new libraries from here. If you go
- 20:53to "Not Installed," let's say you need
- 20:56Pandas, you search for Pandas, click on
- 20:59it, and click "Apply" from here. So,
- 21:02what will this do? It will
- 21:03automatically download Pandas. So, you
- 21:05have both options available. You can do
- 21:07it via the GUI, or you can do it via
- 21:08the command prompt. It's just that
- 21:10their command prompt—their GUI is a
- 21:12bit sluggish. So, I prefer using the
- 21:13command prompt. Okay? Now, let me
- 21:15quickly show you how you can delete
- 21:17this environment. Because generally,
- 21:18what happens? If you complete a project
- 21:20, you remove its environment from your
- 21:21machine afterwards. You push it to
- 21:23GitHub. Right? So, there are two ways.
- 21:24Either click on "Remove," or you can go
- 21:27to the command prompt and type this.
- 21:29You type ` conda remove--name campusx--
- 21:34all`. "All" means you are removing all
- 21:39dependencies, we are removing
- 21:42everything, and then press "Yes" and
- 21:47enter. These prompts are coming up, and
- 21:52after a while, if you notice, this
- 21:54thing will be gone. I will just wait.
- 21:56So you can see, we have removed
- 21:57everything. So at this point, if you
- 22:00type ` conda activate campusx`, it
- 22:03should give you—it didn't remove, I
- 22:06guess, or maybe it has. It takes a
- 22:09little time to update. As you can see
- 22:11here, it's gone. So first of all, I
- 22:14will deactivate, and now I will type
- 22:19here ` conda activate campusx`. I guess
- 22:25the folder hasn't been deleted. The
- 22:26folder created for campusx hasn't been
- 22:28deleted. But if you try to install
- 22:30anything, it shouldn't work. Let's see.
- 22:35Oh, it is working. That's strange. I
- 22:37guess I should close this and try again
- 22:40because it is taking some time. So I
- 22:44will just wait, and now I will run `
- 22:48conda` and here I would write ` conda
- 22:52activate campusx`—it keeps switching
- 22:56back. I don't know why...` conda
- 22:59install`—no, I think I need to
- 23:03restart once. You guys should try this
- 23:05out. It has been removed from here. It
- 23:08shouldn't have appeared there either,
- 23:09but somehow it is. So anyways, this was
- 23:12the whole concept of virtual
- 23:14environments. The whole idea is that
- 23:17you want to work on a new project in a
- 23:20completely blank, new setup. So that
- 23:22there are no issues on the server. That
- 23:24is the whole idea. Right? So that's
- 23:26done. Now, let me quickly tell you two
- 23:28more things. How to work on CG, how to
- 23:31work on Google Colab, and lastly, I'll
- 23:33show you a trick on how you can run CG
- 23:35data on Google Colab. Okay? Okay, now
- 23:38guys, I will show you where I
- 23:40personally work. A year or two ago, I
- 23:43used to work on Anaconda. Whenever I
- 23:47had a project—not actually a project,
- 23:49but in general, if I was working on
- 23:50something, teaching, or studying—I
- 23:52used to use Anaconda. But in the last
- 23:56couple of years, whenever I have any
- 23:58small task related to data science, I
- 24:01don't code on my local machine
- 24:03environment. Instead, I either use
- 24:06Kaggle or I use Google Colab. Okay? So,
- 24:10if you are a beginner and don't want to
- 24:12install Anaconda or anything, you can
- 24:15go directly to Kaggle. Because most of
- 24:18the time, the datasets you find are on
- 24:20Kaggle anyway. So, you just need to
- 24:24search for any dataset on Kaggle, like
- 24:27Titanic; and you just go there, like
- 24:30here you'll go to 'Code', and you'll
- 24:33see an option called 'New Notebook'.
- 24:37Whenever you visit any dataset, you
- 24:38will see the 'New Notebook' option. For
- 24:40instance, let's say I'm going to
- 24:42Twitter. So, after searching a lot,
- 24:45datasets appeared, and let's say I
- 24:47entered this dataset. And now, what do
- 24:49I need to do? I need to code something
- 24:51related to this. So, I will click on '
- 24:54New Notebook'. What will this do? It
- 24:56will create a notebook in Kaggle too. A
- 24:59Jupyter notebook. Okay? This is the
- 25:01Jupyter notebook. I can rename it from
- 25:05here. I can write anything. 'Test Run',
- 25:09and that's it. It is exactly the same
- 25:12thing. Look here, you have two options:
- 25:14'Code' and 'Markdown'. If you need the
- 25:16dataset, you just need to run this
- 25:18first cell. This first cell will give
- 25:20you the file path. Like this is your
- 25:22CSV file path. And along with it, it
- 25:24will also import NumPy and Pandas for
- 25:26you. Here, you can simply write `
- 25:28pd.read_csv`. And here, you can paste
- 25:33the path and run it. And look here,
- 25:36guys, your dataset has appeared. Okay?
- 25:38You can store this in a variable. And
- 25:41you can do all those things here as
- 25:43well. Like markdown, if you want to
- 25:45write something, uh...Hello World. Okay
- 25:49? If you want to make it bold. To bold
- 25:52it in markdown, you use a combination
- 25:54of two asterisks. See, and you can do
- 25:57everything here that you were able to
- 26:00do on your machine using Anaconda,
- 26:02right here in Kaggle. So personally,
- 26:06most of the time what I do is search
- 26:08for datasets on Kaggle and run them
- 26:11right here. It saves a lot of time. If
- 26:13you want, you can share it with others
- 26:15immediately. You just have to make it
- 26:17public. Okay? And secondly, you have to
- 26:21save it. You can save it. And as soon
- 26:25as you save it, it becomes visible to
- 26:27other people on Kaggle. So if you get
- 26:29upvotes on Kaggle, it also enhances
- 26:31your profile on Kaggle. That's why I
- 26:34prefer writing these kinds of codes in
- 26:36Kaggle, but if you are working on
- 26:38projects, obviously you won't use
- 26:39Kaggle. Okay? Second, if you have your
- 26:44own dataset and you want to upload it,
- 26:47you can go here and what you can do is
- 26:50go into input and, uh...Actually, I
- 26:55don't remember. Plus, I guess I used it
- 26:59somewhere. Yes, add data, from here I
- 27:03can use my own personal dataset. See,
- 27:06upload a dataset, browse files, and
- 27:08like I have a dataset called cars on my
- 27:11machine. Let's give it a data name,
- 27:15cars. .csv or cars123, it needs some
- 27:23unique URL, and I created it. See, it
- 27:29says we are processing your data, it's
- 27:32processed and...Now if you run this,
- 27:39see, it is here, if I run this again,
- 27:42then I have the cars one too. So I can
- 27:45copy this path and I will paste it over
- 27:49here like this. And if I run it now and
- 27:53write df here, then here is my entire
- 27:56car data. Okay? So even if your data is
- 27:59not available on Kaggle, but you want
- 28:02to use this Kaggle interface, this UI,
- 28:05you can do so by uploading data this
- 28:07way. Okay! Another good thing is that
- 28:10you can download it from here. Okay, so
- 28:13I'm doing this notebook like this. See,
- 28:15it ran and it downloaded. Now, if you
- 28:18want, you can upload it to Git, keep it
- 28:19on your machine, or share it with
- 28:21someone—it's up to you. Okay, here,
- 28:23if you generate something—anything
- 28:25you generate—how is it generated?
- 28:29Let's say I want to generate this DF as
- 28:31an output. So, I can do that too. I can
- 28:35write ` df.to_csv`, file name `
- 28:37cars.csv`, and run it. If I go to
- 28:41output and refresh, see, the CSV is
- 28:44here, and I can download it from here,
- 28:47and it will download. So, during
- 28:52execution, if you are generating
- 28:53something you need, it can be any file,
- 28:55and you can download it this way. Right
- 28:58? So, the Kaggle interface is really
- 29:00great. The only problem is that you
- 29:02don't have a GPU, a graphics card, here
- 29:05. So, if you are working in deep
- 29:07learning, the execution will be very
- 29:10slow here, and the solution to that is
- 29:12Google Colab, which we will study next.
- 29:15So, another tool we have is Google
- 29:17Colab. It belongs to Google. Obviously,
- 29:20everything is the same. There is just
- 29:22one advantage to it. Actually, there
- 29:23are two advantages. The first advantage
- 29:25is that this tool is directly linked to
- 29:28your Drive account. So, whatever you
- 29:30code is automatically saved in your
- 29:32Drive account. Like, I have all these
- 29:34notebooks saved here. Right? If you
- 29:36want, you can create a new notebook.
- 29:39Which, again, is just a Jupyter
- 29:41notebook. There is nothing particularly
- 29:42different. This is just an online
- 29:43version of a Jupyter notebook,
- 29:44everything. Either in Kaggle or in
- 29:46Google Colab. See, here if you want,
- 29:49you can rename it "Test Run," and you
- 29:51have the same options for code and text
- 29:54; exactly the features you had, you run
- 29:57it here just the same by hitting Shift
- 30:00+ Enter to get the output. The second
- 30:04benefit of using Google Colab is that
- 30:05you have the power of a GPU here. So,
- 30:09if you are studying deep learning
- 30:11alongside and don't have a very good
- 30:13machine—let's say you don't have a
- 30:15machine with a great graphics card—
- 30:17you can use Google Colab. Right? Here
- 30:20you go to Runtime, where did it go? I
- 30:23keep forgetting the settings. And by
- 30:25going to Change Runtime Type, you can
- 30:28select GPU under Hardware Accelerator.
- 30:31Okay? Like this. Now, your deep
- 30:33learning code—obviously, your machine
- 30:35learning code won't use the GPU. Your
- 30:38deep learning code runs much faster
- 30:40compared to the CPU. Okay? In fact, you
- 30:43can use TPU here as well. If your code
- 30:45libraries support TPU, your code will
- 30:48run even faster. The only issue here is
- 30:50that you don't have datasets directly
- 30:52like on Kaggle. So, you have to upload
- 30:54the datasets. Okay? How do you upload?
- 30:56It's very simple. Ran it. Here is the
- 30:59cars dataset, and it is uploaded. I
- 31:02just need to copy its path. And here, I
- 31:05will have to import pandas as pd; all
- 31:08these libraries are pre-installed. As
- 31:11we have seen so far, in pandas, I would
- 31:14write pd.read_csv. And here, I will
- 31:19just paste the path, and now if I run
- 31:21the df, I will get the same. Okay? So,
- 31:24if you have any dataset on your machine
- 31:26, you can bring it here directly. Okay?
- 31:28All the features are available here for
- 31:30you as well. You can go to File and
- 31:32download it. Where did the download
- 31:35option go? There it is; you can
- 31:37download it as a Python file or in
- 31:39Jupyter Notebook format. Okay? You have
- 31:42GPU support. All these files are
- 31:44automatically being saved to your Drive
- 31:45. So, Google Colab is also a great
- 31:48option. So, either I use Google Colab
- 31:51or I use Kaggle. As long as I am not
- 31:53building a project, I work on these two
- 31:55, and I have never faced any issues as
- 31:57such. Okay? So, now I will tell you one
- 31:59last thing in this video. After that,
- 32:01we will close this video. That is, if
- 32:04you are working in deep learning and
- 32:06let's say you don't have a machine with
- 32:08a great GPU, then obviously you will
- 32:11try to use Google Colab. But in Google
- 32:13Colab, you have to upload the dataset.
- 32:15Right? Now, the datasets that you will
- 32:17mostly find will be on Kaggle. All the
- 32:20great datasets you find related to
- 32:22image processing, like those very large
- 32:24datasets. For example, there is a mask
- 32:27detection dataset. See, now take this
- 32:30dataset for example. Like, this is the
- 32:34dataset. There are also very large
- 32:36datasets. Like, what will I do with 23
- 32:37GB? Let's go with the 2GB one, I'll
- 32:39show you. This is the 2GB dataset.
- 32:41Right? Uh, these are CSV files. Yes,
- 32:45this is the dataset. It will contain
- 32:47all the images. Here are all the images
- 32:51. Right? These are all the images. Now,
- 32:53what do I have to do? If I'm using
- 32:56Google Colab, I would have to download
- 32:57all these images and then upload them
- 32:59here. Right? Which is a very hectic
- 33:02task. You won't be able to do that. So,
- 33:04I will tell you a quick trick so that
- 33:06you can bring any Kaggle dataset, no
- 33:09matter how big, directly here and work
- 33:12on it. The benefit is that you have the
- 33:15power of Google Colab's GPU and the
- 33:18Kaggle dataset. In short, you won't
- 33:20need to buy a very expensive computer
- 33:23for deep learning. You can manage your
- 33:25work in Google Colab. Yes, it's a
- 33:26different story if you are building
- 33:28projects, then it gets a bit difficult.
- 33:30But if you are just in the process of
- 33:32learning, this will easily solve your
- 33:34purpose. Right? So, we will see this
- 33:36next. Okay guys. So let's start. Uh,
- 33:38what do we have to do? We need to bring
- 33:41this dataset from Kaggle to this place
- 33:44here. Right? So first of all, what do
- 33:48you have to do, guys? You have to go to
- 33:50your account on Kaggle. That is step
- 33:53one. You will go to your account and
- 33:55from there you have to download an API
- 33:58token. See, you have to create a new
- 34:00API token. So once you click on this, a
- 34:04file will automatically download to
- 34:06your machine. What you just have to do
- 34:09is, go here and upload this file. Right
- 34:11? Uh, Kaggle. See, this is the file. So
- 34:17yeah guys, our file has been uploaded.
- 34:19Now what do we have to do? We have to
- 34:22copy these two lines of code and run
- 34:24them here. Basically, we are creating a
- 34:26directory called Kaggle and copying/
- 34:28pasting into it. Right? This file,
- 34:30kaggle.json. So if I run this, you
- 34:32won't see any output. But this step is
- 34:34important. Right? After that, what do
- 34:36you have to do? Whatever dataset you
- 34:39want to use, go to its page, click here
- 34:42, select copy API command, and paste
- 34:45that API command here. Just make sure
- 34:49to add an exclamation mark before it
- 34:51because it is a command. Okay? Now, as
- 34:53soon as you run this, the data will be
- 34:56downloaded into this Colab folder. Okay
- 35:00? So you can see it's very fast. It's
- 35:01downloading at around 100, more than
- 35:04100 Mbps. So this data will be
- 35:06downloaded and arrive here very quickly
- 35:07. Okay? If you try to do this manually,
- 35:09it takes a lot of time. Because first
- 35:11you download 2GB then you upload 2GB,
- 35:13and with small files, it would take a
- 35:15lot of time. Here, you can see how fast
- 35:17it was. Right? If I refresh this. So
- 35:20you can see, here is my data. Okay? The
- 35:22only problem with this data is that it
- 35:24is in zip format. And what will you
- 35:26need? Each file separated. So there is
- 35:28a custom code for that too. You have a
- 35:30module called zipfile. You just have to
- 35:32paste this code here. Where you just
- 35:35need to put the file name in this spot.
- 35:37Okay? That's it. And now as soon as you
- 35:39run this, what will it do? It will
- 35:41unzip this entire zip file right here
- 35:43and extract all the files. It might
- 35:46take a little time. And guys, this step
- 35:48is done. If I refresh it again. So you
- 35:50can see, here is our medical mask data.
- 35:52If I click on it. Here is that folder.
- 35:54Here is that folder. And here are all
- 35:57the images. It takes a little time. See
- 36:02, these are all the images. Now you can
- 36:05use libraries like Keras to use them
- 36:07immediately. But that is not our
- 36:09concern. I just wanted to show you how
- 36:11you can bring and import very large
- 36:13datasets into Google Colab. And why
- 36:15were we doing this? Because I have the
- 36:17power of a GPU here. So even if I don't
- 36:19have a powerful machine myself, I can
- 36:22always use Google Colab. Okay? So yeah,
- 36:25guys. I have explained many things to
- 36:30you in this video. Trust me, it took me
- 36:32a long time to learn all these things
- 36:34or solve these problems. So that's why
- 36:36I thought I would teach you all of this
- 36:38in a single video. So that it can serve
- 36:40as a reference for you. In the future,
- 36:42if you are ever trying any of these
- 36:43things, even when you move into deep
- 36:45learning, you can refer back to this
- 36:46video. You likely won't face any more
- 36:48issues related to tools in machine
- 36:50learning. Okay? So yeah, that's it for
- 36:53today. Tomorrow, we will look at an
- 36:55end-to-end machine learning project
- 36:57example to get a bird's-eye view. So
- 36:59yeah, if you liked this video guys,
- 37:01please consider subscribing and do
- 37:02share it too. So yeah, see you tomorrow
- 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.