Welcome back I'm so excited for this section.
Why.
Because we're going to start getting hands on with one of my favorite tools in all of machine learning
and data science.
Now in the past couple of sessions we've gone through this kind of workflow we've got your computer.
We set up a project folder.
We create an environment with some machine learning and data science tools using Conda.
Now we're going to start diving deeper into each one of these tools and more specifically in this section
we're going to be focused on Jupiter notebooks.
Now if this diagram this arrow pointing here these arrows going here you're like what's going on here
Daniel.
Don't worry we're going to have a look at this over the next few sections.
But what we're focused on for the moment are Jupiter notebooks which is kind of like the workspace of
where where you work through all of your machine learning and data science projects.
And now this is the workflow we're going to be using.
You'll have a project folder which we've already created.
We'll have an environment.
So we'll need to make sure we activate our environment.
So we have access to these tools.
But then once we've kind of got our heads around Jupiter notebooks and these other ones this is what
it will look like in practice.
You'll have some data you'll imported into your Jupiter notebook and then you'll use a bunch of these
tools within your environment to derive insights and gain information out of that data.
That's enough of the overview for now let's get hands on and work with a Jupiter notebook what I'm gonna
do is open up terminal if you're on Windows you may want to open up a clear event.
So we've got a clean workspace here on windows you may want to open up the anaconda prompt and now remember
how I said we're going to have to activate our environment to have access to these tools.
That's what we'll do first but actually we're going to change into our project folder.
Now for me I'm going to change to the desktop and I've got all of my information all of the project
folders that I'm working on in the normal course folder.
So we're going to go here.
Mine's called sample project.
Yours might be different but I'll just show you what's in this.
Using less remember C D stands for change directory.
So now I'm in my sample project folder and inside the sample project folder is a folder called M just
to re-emphasize where we are.
Let's go.
I'll go into finder.
This might be folder navigator on windows or something like that.
So I mean M.L. course.
And if I go over here I mean sample project.
There we go.
We've got em.
Now what I'm going to have to do is activate this environment.
So I have access to all of my machine learning tools.
So let's do that.
Conda activate going to have to type in the file path.
Yours may be different to mine depending on where your environment is stored but that's what we covered
in the last lecture is setting up an environment and activating it.
So you want to go ahead and activate that environment again desktop email course sample project and
so if I press enter here you'll notice that it changes from base to having this path name activated.
So now my environment is active I should be out to start up a Jupiter notebook.
We made a mistake.
Notebook by typing in the command Jupiter notebook and heading into what this is going to do is automatically
load up your browser your default browser is gonna come to the Jupiter dashboard.
Very simple here.
Again this is just another view of of what we can see in the sample project folder.
So here we have our end folder.
We looked inside that if we go back into finder we look inside and we've got the exact same folders
here.
This is where we're working now.
What should you pay attention to on this.
First we'll go back to the home section we look here.
This is showing the files that we've currently got in this folder.
Remember we're in the sample project folder.
Then if you come over here we've got a couple of buttons upload and new.
We'll have a look at those in a second.
And you've got two other tabs here running.
We'll show you any terminals that you have running in your Jupiter interface notebooks we'll show you
any notebooks that you have running.
And because we have neither of these running at the moment it says there are no terminals running.
There are no notebooks running that clusters you don't really have to worry about for now I've been
working on machine learning projects for last couple of years and have never looked at the clusters
tab.
So we'll come back here we'll focus on on what really matters.
So what are these upload and new buttons.
Well let's have a look.
We click upload what happens.
This is going to open up your folder interface.
Now what if we did want to upload something for example.
I've got a heart disease dot CSC document here for the sake of this lecture.
But your you might be have another type of data folder here.
So what we can do is if we wanted to we can open that and this is going to upload it to the Jupiter
dashboard.
But in reality all it's actually doing is if we come back to sample project where we were before now
we can see we've got m m and heart disease and heart disease.
So realistically this upload button is just like another form of of transfer one folder to another region.
So we can do that again.
Let's try and image this time and now this upload will work with any folder or any file that you want
to try out.
So try it out on your own if you want a link to these resources that I'm using will be available in
the resources section so we'll upload this image click there.
So now we go back to find a go to where we were sample project so we can see now we've got the exact
same thing in here and six step email frame worked up Angie and heart disease dot CSC.
OK.
There's one more button we should pay attention to that's the new we click on new and this is the most
exciting part we can start a notebook.
Now it says Python 3 because when when we click on this it's going to create a new notebook and the
notebook will be able to run Python 3 code which is what what we want right.
We want to be writing Python code.
We want to be writing machine learning code.
You can also create text files create another folder if you wanted to or create a terminal window.
We won't have a look at those now because we're focused on notebooks which is where we'll spend the
majority of our time.
So we click here it will open up a new window.
And here we go.
The most beautiful thing in all of data science and machine learning.
Maybe aside from the algorithm that's working really well.
Is the Jupiter notebook.
And so again this interface might look a bit confusing if you've never seen it before but don't worry
we're going to go through it to start off.
Up here is the title of your notebook.
So maybe we call it example notebook.
This will rename your file and if we click this little save icon it's going to gonna say that it's auto
saved here but really we click save.
That's right.
We come back here.
What do we notice they've got example notebook that I Spy and B.
So see what I mean.
If you type in here example no let's just change this for demonstration example notebook one rename.
That's going to change this name.
And so if we come back to our sample project folder
you'll notice we now have example notebook dot I pi and the now one is I pi and B stand for well I Python
notebook which is what Jupiter used to be called but they've kept the file extension is there so that
older versions of of notebooks don't break.
So wherever you see this extension some named AI pi and b this is actually a Jupiter notebook.
Now if we check the running tab we can see that we now have a notebook running.
We don't have to pay too much attention to this shut down button from from this running tab because
we can we can shut down our notebook elsewhere but we'll look at that in a future video.
The next thing to think about.
Let's rename this back to example notebook is what is actually going on here now is a quick overview
remember this is the title.
This is going to be the menu bar which is similar to what you may have seen in other applications where
you've got File Edit You've got a few different controls here.
This is the toolbar right so these are commands that you can use on different cells.
And this is a cell.
The most important thing to remember about this is that this cell can contain code or markdown content
and can contain other things as well.
But the two main ones you'll be worried about a code and markdown code was what allows you to write
Python code in here and mark down allows you to write formatted text.
So if we wanted to write Hello world we're going to press shift and enter.
Now we go we've got we've got some text there.
All right.
Say this lecture from getting too long.
We're going to have a look at different things that we can do with cells different things that we can
do with these these little tools here in the next video.
But the takeaway from this is that you can start a Jupiter notebook once you've got your environment
activated.
If your terminal window changes to something like this after you run the command you put a notebook
that is completely normal.
What this is saying is basically a Jupiter notebook is running at the local host which is on your computer.
You can see here local host.
So it just means that a document is running in your browser.
So keep this as it is.
We'll return back in the next video to look at more controls and things we can do within Jupiter notebooks.