1 00:00:00,630 --> 00:00:04,180 Welcome back I'm so excited for this section. 2 00:00:04,200 --> 00:00:04,760 Why. 3 00:00:04,770 --> 00:00:10,710 Because we're going to start getting hands on with one of my favorite tools in all of machine learning 4 00:00:10,980 --> 00:00:12,550 and data science. 5 00:00:12,630 --> 00:00:16,720 Now in the past couple of sessions we've gone through this kind of workflow we've got your computer. 6 00:00:16,800 --> 00:00:18,650 We set up a project folder. 7 00:00:18,690 --> 00:00:23,760 We create an environment with some machine learning and data science tools using Conda. 8 00:00:23,760 --> 00:00:30,480 Now we're going to start diving deeper into each one of these tools and more specifically in this section 9 00:00:30,480 --> 00:00:33,880 we're going to be focused on Jupiter notebooks. 10 00:00:33,880 --> 00:00:39,780 Now if this diagram this arrow pointing here these arrows going here you're like what's going on here 11 00:00:39,780 --> 00:00:40,120 Daniel. 12 00:00:40,140 --> 00:00:43,570 Don't worry we're going to have a look at this over the next few sections. 13 00:00:43,740 --> 00:00:49,680 But what we're focused on for the moment are Jupiter notebooks which is kind of like the workspace of 14 00:00:49,680 --> 00:00:54,560 where where you work through all of your machine learning and data science projects. 15 00:00:54,690 --> 00:00:57,630 And now this is the workflow we're going to be using. 16 00:00:57,630 --> 00:01:00,230 You'll have a project folder which we've already created. 17 00:01:00,300 --> 00:01:01,490 We'll have an environment. 18 00:01:01,530 --> 00:01:04,670 So we'll need to make sure we activate our environment. 19 00:01:04,680 --> 00:01:07,060 So we have access to these tools. 20 00:01:07,320 --> 00:01:12,180 But then once we've kind of got our heads around Jupiter notebooks and these other ones this is what 21 00:01:12,180 --> 00:01:13,750 it will look like in practice. 22 00:01:13,800 --> 00:01:19,260 You'll have some data you'll imported into your Jupiter notebook and then you'll use a bunch of these 23 00:01:19,260 --> 00:01:25,860 tools within your environment to derive insights and gain information out of that data. 24 00:01:25,920 --> 00:01:32,010 That's enough of the overview for now let's get hands on and work with a Jupiter notebook what I'm gonna 25 00:01:32,010 --> 00:01:37,940 do is open up terminal if you're on Windows you may want to open up a clear event. 26 00:01:37,970 --> 00:01:44,130 So we've got a clean workspace here on windows you may want to open up the anaconda prompt and now remember 27 00:01:44,130 --> 00:01:49,210 how I said we're going to have to activate our environment to have access to these tools. 28 00:01:49,230 --> 00:01:54,360 That's what we'll do first but actually we're going to change into our project folder. 29 00:01:54,360 --> 00:02:02,700 Now for me I'm going to change to the desktop and I've got all of my information all of the project 30 00:02:02,700 --> 00:02:05,790 folders that I'm working on in the normal course folder. 31 00:02:06,300 --> 00:02:07,500 So we're going to go here. 32 00:02:07,500 --> 00:02:09,250 Mine's called sample project. 33 00:02:09,270 --> 00:02:12,730 Yours might be different but I'll just show you what's in this. 34 00:02:12,750 --> 00:02:17,060 Using less remember C D stands for change directory. 35 00:02:17,160 --> 00:02:24,390 So now I'm in my sample project folder and inside the sample project folder is a folder called M just 36 00:02:24,390 --> 00:02:26,360 to re-emphasize where we are. 37 00:02:26,400 --> 00:02:27,030 Let's go. 38 00:02:27,090 --> 00:02:28,290 I'll go into finder. 39 00:02:28,290 --> 00:02:31,700 This might be folder navigator on windows or something like that. 40 00:02:31,750 --> 00:02:33,590 So I mean M.L. course. 41 00:02:33,870 --> 00:02:37,360 And if I go over here I mean sample project. 42 00:02:37,380 --> 00:02:38,010 There we go. 43 00:02:38,010 --> 00:02:38,900 We've got em. 44 00:02:39,330 --> 00:02:41,750 Now what I'm going to have to do is activate this environment. 45 00:02:41,760 --> 00:02:44,900 So I have access to all of my machine learning tools. 46 00:02:45,000 --> 00:02:45,970 So let's do that. 47 00:02:46,010 --> 00:02:49,940 Conda activate going to have to type in the file path. 48 00:02:49,980 --> 00:02:55,200 Yours may be different to mine depending on where your environment is stored but that's what we covered 49 00:02:55,200 --> 00:02:58,690 in the last lecture is setting up an environment and activating it. 50 00:02:58,710 --> 00:03:09,190 So you want to go ahead and activate that environment again desktop email course sample project and 51 00:03:10,240 --> 00:03:18,310 so if I press enter here you'll notice that it changes from base to having this path name activated. 52 00:03:18,310 --> 00:03:23,570 So now my environment is active I should be out to start up a Jupiter notebook. 53 00:03:23,730 --> 00:03:24,690 We made a mistake. 54 00:03:24,730 --> 00:03:32,050 Notebook by typing in the command Jupiter notebook and heading into what this is going to do is automatically 55 00:03:32,050 --> 00:03:37,690 load up your browser your default browser is gonna come to the Jupiter dashboard. 56 00:03:37,870 --> 00:03:39,340 Very simple here. 57 00:03:39,340 --> 00:03:45,580 Again this is just another view of of what we can see in the sample project folder. 58 00:03:46,090 --> 00:03:48,360 So here we have our end folder. 59 00:03:48,370 --> 00:03:56,080 We looked inside that if we go back into finder we look inside and we've got the exact same folders 60 00:03:56,110 --> 00:03:56,890 here. 61 00:03:56,890 --> 00:03:59,640 This is where we're working now. 62 00:03:59,750 --> 00:04:02,720 What should you pay attention to on this. 63 00:04:02,750 --> 00:04:07,900 First we'll go back to the home section we look here. 64 00:04:07,940 --> 00:04:11,750 This is showing the files that we've currently got in this folder. 65 00:04:11,750 --> 00:04:14,370 Remember we're in the sample project folder. 66 00:04:14,520 --> 00:04:17,650 Then if you come over here we've got a couple of buttons upload and new. 67 00:04:17,660 --> 00:04:19,590 We'll have a look at those in a second. 68 00:04:19,760 --> 00:04:22,640 And you've got two other tabs here running. 69 00:04:22,640 --> 00:04:27,770 We'll show you any terminals that you have running in your Jupiter interface notebooks we'll show you 70 00:04:27,770 --> 00:04:29,710 any notebooks that you have running. 71 00:04:29,840 --> 00:04:34,500 And because we have neither of these running at the moment it says there are no terminals running. 72 00:04:34,520 --> 00:04:40,490 There are no notebooks running that clusters you don't really have to worry about for now I've been 73 00:04:40,490 --> 00:04:44,150 working on machine learning projects for last couple of years and have never looked at the clusters 74 00:04:44,150 --> 00:04:45,020 tab. 75 00:04:45,200 --> 00:04:49,400 So we'll come back here we'll focus on on what really matters. 76 00:04:49,530 --> 00:04:52,290 So what are these upload and new buttons. 77 00:04:52,290 --> 00:04:53,310 Well let's have a look. 78 00:04:53,310 --> 00:04:55,140 We click upload what happens. 79 00:04:55,260 --> 00:04:58,530 This is going to open up your folder interface. 80 00:04:58,540 --> 00:05:02,020 Now what if we did want to upload something for example. 81 00:05:02,040 --> 00:05:07,040 I've got a heart disease dot CSC document here for the sake of this lecture. 82 00:05:07,070 --> 00:05:10,770 But your you might be have another type of data folder here. 83 00:05:10,800 --> 00:05:17,010 So what we can do is if we wanted to we can open that and this is going to upload it to the Jupiter 84 00:05:17,010 --> 00:05:18,120 dashboard. 85 00:05:18,240 --> 00:05:26,250 But in reality all it's actually doing is if we come back to sample project where we were before now 86 00:05:26,250 --> 00:05:31,950 we can see we've got m m and heart disease and heart disease. 87 00:05:31,950 --> 00:05:39,320 So realistically this upload button is just like another form of of transfer one folder to another region. 88 00:05:39,540 --> 00:05:41,450 So we can do that again. 89 00:05:41,550 --> 00:05:47,490 Let's try and image this time and now this upload will work with any folder or any file that you want 90 00:05:47,490 --> 00:05:48,350 to try out. 91 00:05:48,540 --> 00:05:53,700 So try it out on your own if you want a link to these resources that I'm using will be available in 92 00:05:53,700 --> 00:05:59,020 the resources section so we'll upload this image click there. 93 00:05:59,610 --> 00:06:10,380 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 94 00:06:10,380 --> 00:06:17,530 same thing in here and six step email frame worked up Angie and heart disease dot CSC. 95 00:06:17,660 --> 00:06:18,280 OK. 96 00:06:18,360 --> 00:06:23,940 There's one more button we should pay attention to that's the new we click on new and this is the most 97 00:06:23,940 --> 00:06:27,230 exciting part we can start a notebook. 98 00:06:27,260 --> 00:06:33,840 Now it says Python 3 because when when we click on this it's going to create a new notebook and the 99 00:06:33,840 --> 00:06:38,610 notebook will be able to run Python 3 code which is what what we want right. 100 00:06:38,610 --> 00:06:40,140 We want to be writing Python code. 101 00:06:40,140 --> 00:06:42,300 We want to be writing machine learning code. 102 00:06:42,300 --> 00:06:48,690 You can also create text files create another folder if you wanted to or create a terminal window. 103 00:06:48,780 --> 00:06:52,440 We won't have a look at those now because we're focused on notebooks which is where we'll spend the 104 00:06:52,440 --> 00:06:54,140 majority of our time. 105 00:06:54,240 --> 00:06:58,210 So we click here it will open up a new window. 106 00:06:58,430 --> 00:06:59,780 And here we go. 107 00:06:59,900 --> 00:07:03,450 The most beautiful thing in all of data science and machine learning. 108 00:07:03,580 --> 00:07:06,450 Maybe aside from the algorithm that's working really well. 109 00:07:06,560 --> 00:07:08,900 Is the Jupiter notebook. 110 00:07:09,070 --> 00:07:14,080 And so again this interface might look a bit confusing if you've never seen it before but don't worry 111 00:07:14,090 --> 00:07:16,510 we're going to go through it to start off. 112 00:07:16,520 --> 00:07:19,130 Up here is the title of your notebook. 113 00:07:19,130 --> 00:07:23,030 So maybe we call it example notebook. 114 00:07:23,270 --> 00:07:31,610 This will rename your file and if we click this little save icon it's going to gonna say that it's auto 115 00:07:31,610 --> 00:07:33,830 saved here but really we click save. 116 00:07:34,370 --> 00:07:34,880 That's right. 117 00:07:34,880 --> 00:07:36,240 We come back here. 118 00:07:36,530 --> 00:07:42,280 What do we notice they've got example notebook that I Spy and B. 119 00:07:42,320 --> 00:07:43,320 So see what I mean. 120 00:07:43,330 --> 00:07:50,000 If you type in here example no let's just change this for demonstration example notebook one rename. 121 00:07:50,140 --> 00:07:51,960 That's going to change this name. 122 00:07:52,010 --> 00:07:54,550 And so if we come back to our sample project folder 123 00:07:57,350 --> 00:08:09,380 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 124 00:08:09,590 --> 00:08:15,620 notebook which is what Jupiter used to be called but they've kept the file extension is there so that 125 00:08:15,860 --> 00:08:18,020 older versions of of notebooks don't break. 126 00:08:18,020 --> 00:08:25,540 So wherever you see this extension some named AI pi and b this is actually a Jupiter notebook. 127 00:08:25,550 --> 00:08:30,290 Now if we check the running tab we can see that we now have a notebook running. 128 00:08:30,590 --> 00:08:35,060 We don't have to pay too much attention to this shut down button from from this running tab because 129 00:08:35,060 --> 00:08:40,270 we can we can shut down our notebook elsewhere but we'll look at that in a future video. 130 00:08:40,340 --> 00:08:41,840 The next thing to think about. 131 00:08:41,990 --> 00:08:48,430 Let's rename this back to example notebook is what is actually going on here now is a quick overview 132 00:08:48,440 --> 00:08:50,030 remember this is the title. 133 00:08:50,240 --> 00:08:55,310 This is going to be the menu bar which is similar to what you may have seen in other applications where 134 00:08:55,310 --> 00:08:59,180 you've got File Edit You've got a few different controls here. 135 00:08:59,240 --> 00:09:05,190 This is the toolbar right so these are commands that you can use on different cells. 136 00:09:05,270 --> 00:09:06,920 And this is a cell. 137 00:09:07,190 --> 00:09:14,900 The most important thing to remember about this is that this cell can contain code or markdown content 138 00:09:14,900 --> 00:09:16,940 and can contain other things as well. 139 00:09:17,030 --> 00:09:22,820 But the two main ones you'll be worried about a code and markdown code was what allows you to write 140 00:09:22,820 --> 00:09:28,230 Python code in here and mark down allows you to write formatted text. 141 00:09:28,330 --> 00:09:33,090 So if we wanted to write Hello world we're going to press shift and enter. 142 00:09:33,110 --> 00:09:35,980 Now we go we've got we've got some text there. 143 00:09:36,070 --> 00:09:36,920 All right. 144 00:09:36,920 --> 00:09:39,660 Say this lecture from getting too long. 145 00:09:39,800 --> 00:09:43,010 We're going to have a look at different things that we can do with cells different things that we can 146 00:09:43,010 --> 00:09:46,660 do with these these little tools here in the next video. 147 00:09:46,940 --> 00:09:52,340 But the takeaway from this is that you can start a Jupiter notebook once you've got your environment 148 00:09:52,370 --> 00:09:53,180 activated. 149 00:09:53,360 --> 00:09:58,580 If your terminal window changes to something like this after you run the command you put a notebook 150 00:09:59,060 --> 00:10:00,610 that is completely normal. 151 00:10:00,830 --> 00:10:07,660 What this is saying is basically a Jupiter notebook is running at the local host which is on your computer. 152 00:10:07,790 --> 00:10:09,820 You can see here local host. 153 00:10:09,860 --> 00:10:13,720 So it just means that a document is running in your browser. 154 00:10:13,790 --> 00:10:15,130 So keep this as it is. 155 00:10:15,200 --> 00:10:20,390 We'll return back in the next video to look at more controls and things we can do within Jupiter notebooks.