1 00:00:00,266 --> 00:00:02,233 And now we're going to tackle very quickly 2 00:00:02,233 --> 00:00:05,700 the very first step of this toolkit, which is the libraries. 3 00:00:05,933 --> 00:00:09,266 How to import the libraries, how to have them ready 4 00:00:09,300 --> 00:00:12,433 any time we start building a new machine learning model will. 5 00:00:12,433 --> 00:00:13,133 There we go. 6 00:00:13,133 --> 00:00:14,500 I will show you this right away. 7 00:00:14,500 --> 00:00:16,166 It's actually very simple. 8 00:00:16,166 --> 00:00:22,000 We're going to import three libraries now which are numpy, matplotlib, and pandas. 9 00:00:22,366 --> 00:00:25,933 NumPy will allow us to work with arrays because indeed you will see 10 00:00:25,933 --> 00:00:30,300 that your future machine learning models will expect some arrays as inputs. 11 00:00:30,466 --> 00:00:33,600 And therefore we need a library to work with these arrays. 12 00:00:33,600 --> 00:00:34,800 And that's numpy. 13 00:00:34,800 --> 00:00:38,633 Then we'll import matplotlib, which is the library that will allow us 14 00:00:38,633 --> 00:00:40,266 to plot some very nice charts. 15 00:00:40,266 --> 00:00:43,800 You will see that we will actually many charts and graphs in this course. 16 00:00:44,133 --> 00:00:48,866 And finally pandas, which will allow us to not only import the data set 17 00:00:48,866 --> 00:00:52,333 but also create the matrix of features and the dependent variable vector. 18 00:00:52,333 --> 00:00:54,900 I will explain, of course, all these concepts later. 19 00:00:54,900 --> 00:00:55,233 All right. 20 00:00:55,233 --> 00:00:59,366 So let's import these libraries in order to import a library in Python. 21 00:00:59,366 --> 00:01:02,466 It's very simple. You start with import. 22 00:01:03,000 --> 00:01:06,300 That's just a command that will allow to import a library 23 00:01:06,300 --> 00:01:09,966 or even a function or any type of modules. 24 00:01:10,100 --> 00:01:13,833 By the way, a library is an ensemble of modules containing 25 00:01:13,833 --> 00:01:18,000 functions and classes with which you can perform some actions and operations. 26 00:01:18,166 --> 00:01:22,600 For example, the most well-known library in data science is scikit learn, 27 00:01:22,600 --> 00:01:25,933 and this is a library that contains actually all the machine learning models 28 00:01:25,933 --> 00:01:30,133 that you can build by simply creating an object of some classes. 29 00:01:30,133 --> 00:01:33,900 So don't worry about all this now we will see that in great detail 30 00:01:33,900 --> 00:01:35,866 each time we build a machine learning models. 31 00:01:35,866 --> 00:01:36,866 But there you go. 32 00:01:36,866 --> 00:01:39,600 You will see that libraries will be super useful for us 33 00:01:39,600 --> 00:01:42,000 in order to build our machine learning models. 34 00:01:42,000 --> 00:01:43,566 So there we go. Import. 35 00:01:43,566 --> 00:01:47,000 Then you need to follow by the name of the library you want to import. 36 00:01:47,200 --> 00:01:50,400 And the first one we want to import is called numpy. 37 00:01:50,700 --> 00:01:53,733 And then what we usually do is we add a shortcut, 38 00:01:53,733 --> 00:01:58,133 because each time we will use a function of the numpy library. 39 00:01:58,300 --> 00:02:00,933 Well we'll have to call first numpy. 40 00:02:00,933 --> 00:02:02,700 And in order to call it faster. 41 00:02:02,700 --> 00:02:06,200 Well we can add a shortcut here so that each time we want to call number 42 00:02:06,400 --> 00:02:08,833 we will actually call it with its shortcut. 43 00:02:08,833 --> 00:02:12,266 And the shortcut we usually use for numpy is NP. 44 00:02:12,266 --> 00:02:15,300 And as you can see, to add the shortcut you simply need to add as 45 00:02:15,300 --> 00:02:17,166 and then the shortcut name. All right. 46 00:02:17,166 --> 00:02:20,233 So each time we will call numpy we will actually call NP. 47 00:02:20,966 --> 00:02:23,466 Then next library import. 48 00:02:23,466 --> 00:02:25,800 So that next library is matplotlib. 49 00:02:25,800 --> 00:02:29,200 And actually as I told you a library is an ensemble of modules. 50 00:02:29,200 --> 00:02:32,500 And here we're interested in a particular module called Pyplot. 51 00:02:32,500 --> 00:02:35,633 And that's the module that allows us to plot very nice charts. 52 00:02:35,966 --> 00:02:39,733 And so here we're not only going to import matplotlib, 53 00:02:39,866 --> 00:02:44,333 but particularly, well the pyplot module. 54 00:02:44,333 --> 00:02:46,533 And as you can see in order to get this Pyplot module, 55 00:02:46,533 --> 00:02:50,400 I added a dot here which allows you to access the different modules 56 00:02:50,400 --> 00:02:54,166 of the matplotlib library and the module we chose is Pyplot. 57 00:02:54,166 --> 00:02:57,033 And again we're going to add a little shortcut here, 58 00:02:57,033 --> 00:02:58,800 which we're going to call plt. 59 00:02:58,800 --> 00:03:01,800 That's the usual name for this Pyplot module. 60 00:03:02,033 --> 00:03:02,400 All right. 61 00:03:02,400 --> 00:03:06,633 And finally we're going to import a final library which is Defenders library 62 00:03:06,633 --> 00:03:11,400 a super useful library to preprocess your data sets and mostly to import them. 63 00:03:11,666 --> 00:03:12,900 And same for this library. 64 00:03:12,900 --> 00:03:16,266 We're going to add the simple shortcut name p d. 65 00:03:16,633 --> 00:03:18,866 And there you go. Congratulations. 66 00:03:18,866 --> 00:03:22,100 Now not only you know how to import the libraries, but mostly 67 00:03:22,100 --> 00:03:25,800 you have your very first data preprocessing tool in your toolkit. 68 00:03:26,266 --> 00:03:27,666 So now we're going to move on to 69 00:03:27,666 --> 00:03:31,166 the second tool which will be to import the data set. 70 00:03:31,500 --> 00:03:33,900 And that's exactly what we'll do in the next tutorial.