Machine Learning Full Course In 10 Hrs | Machine Learning Full Course For Beginners | Simplilearn
Key Takeaways
Provides a comprehensive 10-hour course on machine learning for beginners, covering core machine learning algorithms, building neural networks, and working with Python and deep learning architectures
Full Transcript
[music] Welcome to this full 10-hour journey into machine learning and deep learning which is designed to take you from beginner to project ready. Whether you are aiming to start a career in AI or preparing for data science interviews or understanding how real world intelligence systems work, then this course gives you everything you need. Before we begin, make sure to subscribe to the channel and hit the button so that you never miss any upcoming AI and tech tutorials. Feel free to share this video with friends who wants to learn machine learning or deep learning. And also guys, drop your questions or suggestions in the comment section. Across the next several hours, you will learn the core machine learning algorithms. We're going to build neural networks from scratch, work hands-on with Python and explore modern deep learning architectures used in the industry. So let's dive in. >> I just want you to definitely have a look at it. And that's a very simple code where just take a moment and try to understand if you are able to understand. Huh? So you have absolute no idea about deep learning. Now here when you look at a code like this you will be like oh my god what is this then when you look at a code like this you know just just have a look at the code. So at least you know maybe some of you may say that yes darian sir we understand you are trying to import something from here. Agreed ch you are smart here you say that okay fine there is something which is getting loaded sir but I don't understand what is this extra and what is this underscore and here is something is converting the data type but what is this expanding we never studied are you having the similar kind of questions which I'm trying to say right now you know I'm just in the convincing mode for Yes. Right. Then now this is the place where I am creating a neural network. Do you understand exactly what is happening from the mathematical perspective in this blue box? Anything anything you'll need to understand how to create a neural network over here. Then after that we do something. So precisely what I want to say is this is absolutely clueless and if we have to understand it uh very properly then we need to be very smart while doing the things. Let's get started. So I was saying over here this is AI which comprises of machine learning which comprises of deep learning which comprises of generative AI which comprises of LLMs Then yeah, machine learning, deep learning, generative AI and ML. Right. So today let us discuss about the ML stuff. So machine learning is all about predictive analytics. Machine learning is and see we are not learning machine learning in deep. I'm only giving you that much idea which is required for executing any project right. So that you know when I step into deep learning all of these things look relevant to you. So we said we have total 14 classes right? So I say first is ML regression, second is ML classification, third is deep learning. neural network creation. Fourth is convolutional neural network. You know these are the names of the classes which I'm planning recurrent neural network LSTM and GRU. Then sixth is now we are good to get started into the generative AI stuff. So one thing that we can get started over here in the generative AI is going to be the GAN which is the topic. Then seventh one is going to be the variational autoenccoder. All of these are advanced topics. Then eighth one is going to be the hugging face. Ninth one is going to be the open AI API. The 10th one will be your lang chain. We need to do the sixth one would be uh this is there in our course attention mechanism and uh transformer architecture. Then we talk about the seventh one which is text generation using attention mechanism. Then the eighth one would be GAN. Ninth one would be V AE. 10th one would be this. 11th one would be this. 12th one would be this fine tuning that can be done using open air playground and API but before that uh could be the concept of rag. Yeah. Yes. I hope it's sorted now, right? Yeah. So, I'll, you know, just uh make a note. Okay. Uh deployment if possible. You know, it depends on how much time I I'll show you. Don't worry. I'll that I'll say uh Right. I think this is what we can finalize. Right. So let's see how the things go ahead and [clears throat] this is something which is important for us. This is like the pathway for us getting started. But you know there is a small drawback of the way we are proceeding because we have our course end projects as well right so the course end projects will talk about all of the things GANs and VA so we will have to little bit work from that perspective as well let's see how we can do it the best yeah so going ahead with this I was saying machine learning is all about predictive analytics so if you want to pred predict the prices of a stock. You want to predict uh how or when a machine is likely to uh stop functioning even before it actually starts function stops functioning. So machine learning is really useful in such scenarios. So I'll get this thing in a very very simple way for you. So, have you heard the story of the lion and fox? Everyone must know this. No worries. I'm going to tell it to you right now. So here friends, so I was saying the lion in this case is going to be nothing but the manager. So I was saying so we have lion and he is the manager and he hired a fox and this fox is you a data scientist. So the lion hired the data scientist and the aim was to help him catch a prey. Remember this, the lion hired a data scientist to help him catch a prey. See, it's not easy for a lion to catch a prey. Have you ever heard, if you have ever been on a jungle safari, when a lion is moving across a jungle, birds start to chirp, monkeys starts to scream and it's a way of signaling other animals like deer, zebras, etc. that the lion has entered this area and vacate this area. So if a lion has to ever hunt, he actually has to hide through the trees so that no one notices him and then he is able to catch the prey. So that is the irony of jungle. When a lion takes around 20 to 25 attempts probably one time he is able to catch the prey successfully. So now this is just like the story of the Shir Khan where the liar hired a data scientist to help him catch a prey. Now what did the fox do? The fox is a data scientist. He started doing the survey of the jungle. What did I say? The fox did survey and this survey took him almost 1 month and he did a detailed survey of the jungle. And you know what the fox came up with? The fox came up with to the lion saying that my dear boss in your jungle there are five giraffes. There are 105 deers. There are 15 elephants. And there are 50 buffaloos. And there are also three hunters. Now my question to you all is the lion hired this guy to help him catch the prey. After 1 month he has come up with this information. Do you think is this information helpful for the lion to catch the prey? I mean just say I mean I'm not looking from the data science perspective. Just let me know that if you are the lion and if the fox comes to you, do you think this information is helpful for the lion to help him catch a prey? So if I am very hungry, I will not go behind the giraffes or the elephants because they are aware in available in limited number. But deers are available in ample number. So the chances or the probability of hunting and killing a deer is very high as compared to all other animals. This is exactly what you are trying to say in your chats. Am I correct? Yes. So friends, what is done by the fox is called as descriptive analytics. So you know what does descriptive analytics analytics basically consist of? It consists of various functions like count or sum, min, max, mean, median, mode, standard deviation, variance, curtosis, skewess. If you don't know some of these terms, that's completely okay for now. But all of this comes under the descriptive statistics and it will help the lion in helping him spot his future hunting ground. Now, this fox continued with his work and now he took another two months. So the fox now came up to the lion with this. He says that my dear boss, this is where you live. That's your home. In your jungle, there is a pond and animals usually come to drink water over here every day between 1:30 p.m. to 2:00 p.m. Now you tell me is this information further useful for the lion? Rather than hunting throughout the day and getting tired, he knows that now I can maybe target for deer in the time duration 1:30 p.m. to 2:30 p.m. because everyone is likely to be found here. That is awesome. That is something which is really awesome. Yes, this is information right now. What if the next information that he says that my dear boss there are two ways you can go from your home to the jungle. That's the first way. And on this way now there are lot of pits, valleys, forests, mountains. It's not really easy to go this way. But yeah, I mean this is another way. Now the question is when you have some algorithm in machine learning imagine this to be machine learning algorithm one and machine learning algorithm two which algorithm will you choose in real life or let's say there is further one more machine learning algorithm three among these three Which one will you choose? Well, tell me among these two ways, which one will you as a lion choose to go to the pawn? One or two? [clears throat] With this obviously a simple understanding is among one and two this way one is shorter. So you will choose the wave 1. Simple understanding is this. But the surprise is here friends. We never discuss about these three people. The fox further says that boss wait before you take a decision let me tell you that I once discussed that there are three hunters also in the jungle. So these hunters usually do the hunting on this in this area. Now my dear foxes which path will the lion choose if you give this information to the lion. So essentially what am I trying to tell you is it is not always in machine learning that choosing the fastest algorithm. No it is not always in machine learning that you have to choose the fastest algorithm. You have to choose the algorithm which is optimize. Well, that purely depends on the business use case. Like for example, I was saying that you know see if uh if we have I might have discussed this example. I'm discussing it once again. If I look at the ADA system of the car where Right. So the duty of the ADA system of the car is when the car is there on autopilot. When the car is there on autopilot then if any person comes all of a sudden the car must apply brakes. The car must apply brakes. Okay. Now what is more important in this case? If a person comes, brakes must be applied. Right? And if a person doesn't come, break must not be applied. What if I say what if I say that if there is a person but the brakes are not applied. That's hazardous, right? If there is a person and imagine the brakes are not applied then accident very much possible. It is listen to me. Yeah. It is okay even if the car thinks that there is a person in front when there is no person and it breaks. But it is not okay under any circumstance when there is actually a person and it does not break. I repeat, listen to me one last time. It is okay if my car thinks that there is a person standing in front when ideally no one is there but it still breaks a little bit but it is not okay when there is actually a person and it does not break. You agree to this? We want safety. So over here what is important to us is safety and we want a fast model. We want a fast model with relatively lesser accuracy is tolerable. Of course, I will try for the best accuracy. But if I'm getting relatively lesser accuracy, but it is fast, I am okay. False positive is okay. Yes. But if you talk about ACP Pruman right everyone knows now who is ACP Pruman yes everyone knows now who is ACP Prahuan yes or no yes I'm basically referring to the C crime investigation department okay you don't watch TV such a famous serial huh And some of them who are not aware of Hindi, they might not know it. But anyways, no problem. So ACP Brahman is just a very famous character from C. So ACP Pruman, right? So yeah, this is the famous CI character, right? So crime investigation department. And I just took his name for fun. So [clears throat] here let's say we have found a criminal you know so he is a rather than saying suspect rather than saying he is a suspect. And now ACB Pradhiman wants to check whether he wants to check whether has this person committed any crime before by going through the database by going through the database. So his face would be matched with all the faces in the C records. Now what is more important over here? I am okay if my model is slow but I need a really high accuracy. It is okay if my model is taking one minute to match this face with all the faces. But it must come back to me with the correct output. If this person has earlier committed some rape or murder or anything must match. His face under any circumstance should not be missed while matching. So here what is important is accuracy. Over there what was important is speed. I am talking about how you choose a machine learning model purely depends on the business use case. So what was done by the fox here in helping that okay this is where most of the animals come choose this road. Well this is what you call as predictive analytics. This is exactly what you call as predictive analytics and what you see over here is about optimization of machine learning algorithm. So now with this background we are good to get started with the introduction to machine learning. So let's get started with ML now. So machine learning is broadly divided into two types, supervised, unsupervised. Both of them are important but our course is on generative AI. So we will not be discussing both. We are just going to discuss supervised. There is third type as well which is semi-supervised. Fourth type as well which is reinforcement. We are only discussing this. So I was saying machine learning is of two types. Supervised and unsupervised machine learning. Now what is supervised machine learning? Well supervised machine learning is the case where you have label data and unsupervised machine learning is the place where you have unlabelled data. What does that mean? Well, before you understand this, it's important to get into little more fundamentals. Yes, we had discussed this. Yes, that's very correct, Malik. So friends, what I am saying is initially this is what is already discussed. I'm just giving you a glimpse of traditional programming paradigm. Earlier what used to happen is you used to have a computer and any program that has to be developed. Let's say you want to write a very basic program for performing let's say even addition of two numbers then on the computer who will be writing the program a software developer. So this program was written by a software developer on the computer. Then to check whether the program is working fine or not, the next thing that we had is we were giving inputs. So let's say if this is a program for addition, we can give inputs like two and three and we expect the output to be five. If I give input as 1.1 and 2.2, we expect the output to be 3.3. So this output was always deterministic in nature where 2 and 3 addition will be five only. It will not be 5.01 1.1 and 2.2 when added will be 3.3 only not 3.301. So that was how the earlier softwares are developed. Now, how does the how is the machine learning programming paradigm? So, in machine learning programming paradigm, I'm actually copying the same figure. Computer is there. We have this inputs and we have this outputs. But the thing is now your inputs are here only. But the output which was there on the right hand side has shifted to the left hand side and the program which is there on the left hand side is shifted to the right hand side. So essentially the program is now written by a computer. The program is written by a computer. So how does that happen? Well, this happens exactly in the same way uh where a question bank and answer bank of 100 questions. First thing what we do is we divide it into two parts. We already know about it and usually it is 80% and 20% but not mandatory but usually people start with this where the first part is called as train next is called as test where this is exactly what I was calling as inputs and outputs. So here you have 80 questions and here you have 80 answers which are going as input and the machine understands the pattern in between the 80 questions and the 80 answers over here. The machine understands the relationship between this and then creates a program or this program in technical words is also called as the machine learning model. Now how to check because see who has created this program? Did you create it? No, this program is created by a machine. So whether to trust or not this particular model is a big question. So what we do? Well, technically we call this question bank as X and answer bank as Y. So this is extreme. This is Y train. Similarly, this is X test. Then here X train Y train X test Y test. This is what we have. And then what is given as input when I say 80 questions is your X train and Y train. The model understands the relationship between them. Uh and it is creating a model. Now how to check whether the model is good or not? Well, I can do one thing. I can give over here extreme and I'll be getting in return prediction. So if I'm giving this 80 questions of course I'll be getting 80 responses. I prefer to call this as y prred on the train and I can also try giving over here x test which is something which it has never seen. So my prediction would be these 20 answers. I prefer to call this as y prediction on the test. So the next thing that we do is I try to compare this and I found the accuracy. This is after comparing I am going to print the train accuracy. Similarly, this and this I can compare because I have the actual answer and I have to predicted answer. So I'm going to compare and print the test accuracy. So basically I understand that my model you know what I did I asked the model to understand the relationship in between X and Y train. So that intelligence is now saved here. So now whether he has actually studied it nicely or not what I do is I give extra extra is I give this part 80 questions over here. So I'll be getting the predictions which is this. Now once I have this predictions now these are my predictions and these are my actuals. I can compare this 80 responses 80 predictions and I get the accuracy on the training data set. How good are the predictions on the training data? Similarly, I gave over here X test which is this. So when I give X test, it give predictions which are this. Then what will I do? I'll compare this actual with this predicted. I'll be getting again the test accuracy and then depending on this I conclude. So the question is what is a good model and this applies for machine learning, deep learning, computer vision, NLP, generative AI everything. What is a good model? A good model is the one where in both of the below conditions A are satisfied. Number one, test accuracy must be greater than equal to 80%. Number two, train accuracy minus test accuracy. The difference must be less than equal to 5%. That's important. The difference in between the two must be less than equal to 5%. That is what is important. Okay. Now, so I am planning to buy a mobile phone. So, we all know that the price of a phone depends on the brand of the phone. Yes, I mean Apple phones are costlier. Samsung is relatively cheaper and then OPPO VO are more cheaper etc. It also depends on the RAM of the phone, ROM of the phone, processor of the phone, screen size of the phone, screen type of the phone and many other factors. I did not say that the price of the phone is dependent on its features. I didn't say that. I wrote down the features one by one. I didn't say that the price of the phone is based on features. Greater the number of features, greater is the price. I did list it down over here very appropriately. I say if I'm trying to uh look at the price of a house. So friends, price of the house depends on what? Let's say I'm looking for a house in a tower. on 10th floor. So the price will depend on what all factors. Oh yes, that's perfect. So the first one is the area of the house in square ft. That's correct. Location matters. As you said, dimension is fine. And then floor number is important. Then builder is correct. Builder is correct but you cannot say amenities. So whose society is better? You're getting the point. You cannot say amenities. Then you are giving incomplete information to predict the price. Right? So you have to say right? Yes. So you have to actually say that hey whether the swimming pool is there or not whether the garden area is there or not then yes location as we wrote that's correct window facing or not yes then we can also look at features like uh whether uh it is near to the subz market or not? Whether how much is the distance to the hospitals nearby? Where will the kids go? Are there schools and colleges nearby? These are also important. Now, you're getting everything cheap, but the school is 50 kilometers away. Connectivity, yes, that's important, right? So, connectivity is again a very generic term. Sanjief you can say that you know distance to railway station, distance to bus stop, age of the house and end of this topic. Okay. Now next. Now tell me in one hand I have apple in another hand I have orange. How do you figure out that this is an apple and this is an orange? Yes. Color, shape, taste. Okay. Texture. Very good point. Why didn't anyone think of smell? Yes, fragrance. Now I got that point. And if I get into technicalities, you can look at the vitamin content, mineral content, etc., etc. If you look at these three flowers, Iris data set. So this is a data set where you have three different flowers of the same species iris. And the way we are differentiating it, the way we are differentiating it is by finding out sele width. Petal and petal bit. So this is found out for total 150 flowers 50 of stosa only two are shown 50 of and 50 of virginica. So the last example is iris data set which says based on petal length petal width sele the classification of the flower is done and this Iris data Okay. Stoa versus virginica. Now here friends we understand that the price of the phone is dependent on these all factors. The price of the house is dependent on these all factors. Whether it is an apple or orange is dependent on these all factors. Whether it is stosa or versic color or virginica is dependent on these factors. So because these all things are dependent on them, I call this in machine learning as dependent variable. And because they are not dependent on them, we call it as independent [clears throat] variables. In machine learning, independent variables are usually given by capital X and dependent variables are given by capital Y. Now, so I can say over here that this is Y. X1, X2, X3, X4, X5, X6. Right? This is how it is happening. Then so now if you look carefully uh example number one and two and example number three and four there is a difference. So in example number one and example number two, the dependent variable is continuous in nature because price of the phone can be anything. Price of the house can be anything. But if you look into example number three and example number four over here, y is categorical in nature because you will either predict it as apple or orange. It will not be a combination of two. Here also you'll either predict the flower as stosa or versicol or virginica. It won't be a combination of the two. So this is what gives me an idea about my topic when I say that machine learning is divided into let's say three types where the first one I said is supervised machine learning. So here I said we have labeled data. Labeled data means independent and dependent variable both are available. Whereas when you talk about the unsupervised machine learning, you have unlabeled data where only X is given and you need to find Y. And the third one is reinforcement learning which is nothing but learning from our own past experiences. learning from our own past experiences. So basically you know the best example over here is what you can consider is the Tesla's autonomous car. It is already taught with lot of intelligence and it is also learning by itself in real time. So that is a example of reinforcement learning. Learning from your own observations. But let's talk about the supervised learning first. Supervised learning is where labeled and unlabelled data both are available. The first part over here is regression and the next is classification. So regression algorithms are the ones where the target variable is continuous in nature just like example one and two above and classification is the one where it is categorical in nature just like apple orange example and Iris data set example. So this is how it happens. Unsupervised learning. I can give you an example as clustering. For example, you know, just giving you a brief idea. We are not going to cover about it. But I don't want to leave the stone unturned. So the question is we are having 28 in the class including me. If I collect all of our mobile phones, could you all please, you know, everyone is going to look at each other's output. What are they typing in the chat? Now, I want you to tell me which brand phone are you using. Do not showcase which phone are you using? Only brand. Only brand. Which brand phone do you use? I'm not looking for the phone model. Okay, if I do the same thing in some other cohort, this number may change. We all understand it. What am I trying to say is if I as a teacher is collecting all of your phones and keeping it on a table. So I have 30 phones kept on a table and I am thinking of clustering it or grouping it on the basis of similarity and I decided to group it on the basis of brand. I got three brands in our class. But if I decide to group it on the basis of RAM here, uh if I'm doing it on the basis of RAM, how many? So now tell me looking at our responses, how many unique brands are seen? Three only. Okay. 10. Do you agree that these three groups are going to be completely different? A Apple phone get can get mixed with a OnePlus phone with respect to RAM because you're not classifying it on the basis of brand. So now the question is I can also do it on the basis of processor. I can also do it on the basis of ROM and many other factors. Right? Because in unsupervised learning, we do not know why. [clears throat] We are only being given X and the aim is to find Y. That's the first example of unsupervised learning. And there are few more other things like you have one more thing over here that we can consider. So the first one can be clustering. Second one can be feature selection. The third one is dimensity reduction. And the fourth one is association role mining. Yes, this is what it is. Okay, so we are getting started with our case study. So we are talking about uh regression algorithms in machine learning. So let me tell you what is the project that we are doing over here. So our data set basically consists of advertising budget spend on TV, radio, newspaper uh for determining the sales of a order. So your role as a data scientist is to determine the best regression algorithm for predicting the sales of the product based on advertisement risk. Now what is this? You know let us first try to see the data set then it will become clear. So I say first is let's do the necessary imports. What all things do we require? I require numpy importing numpy as n. It is mainly used for numerical computations. I require pandas for data manipulation and analysis. I reper Mattplot lift for data visualization and I'm also taking seaborn for data visualization and I'm also loading the warnings library because I want to ignore any kind of warnings. So I am importing the warnings library and I'm saying that I want to ignore the warnings by using the filter warning function. That's always a good practice to have at the start of every machine learning project. Now the data set is this. I will download it as well. Save as and Here I say DF is equal to PD. CSV advertising data set and let us look at the number of rows and columns. So this data set consists of 200 rows and five columns. Let us look at the head which is the first five rows of the data set. So as I told you what is the problem now. So the problem is this. This data set consist of advertising budget spent on TV, radio, newspaper. to a company when spends $230.1,000 for advertisement on TV, $37.8,000 for advertising on radio and $69.2,000 for advertising on newspaper. The sales that it is able to get is $22.1,000. Similarly, you have 199 more records. So here friends, these are the three independent variables and this is the dependent variable. I repeat that's the independent variable and that's the dependent variable and this is the main problem statement. So now the first thing is the column this is unnecessary column I don't want it. So the first thing is let's drop the unnamed column zero because it is not useful. So I say I'll be doing that using the drop function. So I say df do. The column name to be drop access equal to one because it's a column and in place equal to true. So do it over here only and that's perfect. Now have a look at this. If I say df do.escribe what I understand pay attention and this is important. This is important important important. When I say describe I see that the average investment on TV is around $150,000. The next highest average investment is on newspaper and on radio it is 23. Do you understand that people prefer TV for investment? The second option is newspaper and the third option is radio because the average of TV is much higher then newspaper and then radio is the least. Uh this is an insight that everyone needs to observe in any machine learning project. Yes, in the same way you know even if you look at the minimum values it is the highest for TV then newspaper then radio and the maximum values as well. Okay. Also because there are 200 rows and everywhere I see 200 that means there are no missing values. Okay. Now let us go ahead and get started with the implementation. Now the first thing what we need to do is uh we need to check for the missing values in the data set. So df dot isisnull dot sum and I always prefer to sort it as I told you earlier as well. So I'm sorting it in the descending order by specifying ascending is equal to false. df dot isnull dot sum. We have already seen this code. I'm not going to explain again unless and until anyone asks me sorting that in the descending order. So all values are zero. Therefore there is no sorting. But in case if there was missing value, you know how it is going to look like. So there are no missing values. That's good inside from the above output. So we see that there are no missing values in the data set. So let's proceed to the next step. And now I want to visualize the relationship between the features and the target variable. So what am I going to do is I'm going to go for core tf doc call and core will be getting me the correlation. Now pay attention. Uh okay let me see. Correct. Correct. See, I'll show you what it means. Uh isnull will see when you say when I say df.isnull, it will give a output something like this. So if it is a false that means this particular value is not null. This is not null. This is not null. This is not null. But if you see anywhere true let's say for reason you see true that means the radio columns fourth value is missing. So what I did is I applied the sum function on that. So it will count how many times it is true in this column, how many times is true in this column and so on. Is this value null or not? This is what is null is checking. Is this value null or not? It says no by saying false. Like if you look into the code the first value is this null or not? False. that means it is not null. Is this null or not? It says false. That means it is not null. Imagine this value is missing. If it is missing, it is basically written as n. N stands for not a number. And if it was not a number instead of 60.2, then this would be having true. That means yes, this value is null. This is what it means. Now we are getting into the correlation. So as you can see correlation, right? So this is how correlation ideally is like if you see perfect positive correlation highest value is one perfect negative correlation lowest value is minus one this is high positive this This is high negative. This is low positive. This is low negative. And this is as good as no correlation. Right? Now we always need between independent variable and dependent variable. We want this correlation to be high. So if this correlation is high, that means independent variable is responsible for predicting the dependent variable. We always want this value to be high. So here let's see. So TV versus sales high correlation very close to one. Radio versus sales decent. And newspapers versus newspaper versus sales. You know what is it saying? This is saying that newspaper is probably not the correct independent variable for predicting the sales. This is not the correct independent variable for predicting the sales. Are you able to understand it? Newspaper is not the correct independent variable for predicting the sales because the correlation has to be either on a + one side or on the minus one side. This is very close to zero. So it is saying that newspaper is less important for predicting sales. TV is most important and radio is next most important because those values are higher. higher the value or the close it is to one we say it is more relevant is that clear to everyone right I'll write down the notes the correlation between TV and sales is 028 which is a strong positive correlations between radio and sales is moderate positive and between newspaper and sales is V positive. So this means that TV is most important feature for predicting the sales of the product. Then radio is second most important and newspaper is the least most important for predicting the sales. Now I say let us separate the features. Features means what? Independent variables and the target which is the dependent variable. So I will separate out features. So features is TV, radio and newspaper. These are the features. So I want to have my X. So X is going to be DF of features. So all the features are going to come and Y will be only the sales. Let us check it out. Oops. Newspaper N is small. No, n is small. That's why it gave an error. Radio also R is small. Yeah. So now if I see so this was how the data set is. Yeah. So this is how the data set is. What I said is features are this. So X is DF of features. So DF of features means DF of this. This is X and Y is DF of sales. This is Y. X and Y then similarly I can also show you Y right? So X and Y separated. Now after separating X and Y then we do train test split. Uh I so there are 200 rows in our data set. So right now this is the scenario x1 x2 x3 y I am planning to divide it into 80/20. I'll show you other variations also but for now I am planning to divide it into 80/20. So I say let's split the data into training and testing. We use the train test split method. So I say from sklearn dot model selection import train test split. Right. This will split the data. How? It gives me four parts. X train, X test, Y train, Y test. So I'm saying that hey I want this X and Y to be further divided into two parts. So X will become X train X test Y train Y test. Right? So x and y will become x train, x test, y train, y test. Test size is 80/20. You can play around with this. Right now I'm keeping it same and random state is used for the same reproducibility. So 200 rows were there. I'm doing 8020. So I think there should be 160 rows over here and 40 rows over here. So I say let's print the shape of this. So 160 and 40 160A 3 40A 3 160A 3 40A 3 160A 40A 160 comma 40A okay yeah it was newspaper I had written it down also it was newspaper if you see we had written it down uh here newspaper is the least important because the value of newspaper was somewhere around yes 0.22 22 that's correct prau but now here the least investment is not on newspaper the least average value is of radio so we don't want that so what am I going to do is see I am a teacher and I am teaching nag leave that leave that for now Okay. Uh let's say for example let's say let's say for example I am teaching Python programming to a group of 50 students in a class. So I see 45 students attend my classes regularly and why don't attend this. The names of these five are Let's say Aay Vijay Sanjay Jay and Mah as a teacher I am very concerned about the students. In fact rather I am also angry with them. So I have decided to take out my grudge on them by giving them less marks in the oral exam even if they perform well. This is what I decided now as a teacher am I doing the right thing? Tell me as a teacher am I doing the right thing that okay let's say Moes is coming and Moes is answering everything very nicely. I don't know from where he studied but he is knowledgeable but still because he didn't come to my class I am like I am going to make him screw is that a good characteristic of a teacher as per ethics no right yes as a teacher where can I give mah actually less marks where can I give mah less marks in the attendance there is there are certain columns for attendance usually five marks or 10 marks marks are there for attendance. I can give zero over there if the university norms allow that okay he's not allowed to sit for exam I can do that but taking out grudge by giving him less marks is not a right idea now our case we have TV radio and newspaper as the features the mean values of TV radio newspaper are 150, 23 and 30 respectively. Right? 150, 23 and 30 respectively. So now let's correlate this example with the student example above. So here TV has the highest mean value that is highest attendance in the class. Radio has the second highest attendance and newspaper has the lowest attendance. So is it fair that the machine learning model gives more importance to TV and less importance to newspaper? Answer is no. See when a machine learning model is being created it should give equal importance because what am I asking model to understand the relationship while understanding the relationship one should not go ahead with this opinion one should understand the relationship as it is and then based on that relationship if you find that is rest relevant that is good but while studying only you are going with the notion let's say for example you have a subject called a supply chain logistics and someone told you that it's a very theoretical subject you attend the class or you don't attend the class it does not matter so what happens is when you go to the subject even if as a teacher I'm teaching it really very nice you will be less interested because someone told you that this subject is not important you pass anyhow etc etc but what about the knowledge you don't have it so you should not go ahead with any such kind of assumptions and that is exactly what I'm saying that once you study the subject then you yourself decide whether it was really worth it or not. In the same way here as well I want you to follow the same strategy. So here, so the question is how to make the machine learning model fair to all the features? Well, the answer is feature scaling. So feature scaling is a way you're scaling all the features into a fixed range and there are various types of feature scaling. So I say there are two common ways of doing the scaling. One is minmax and one is standardization which is also called as zcore normalization. What does minmax do? It will scale all the values in the range 0 to 1. I'll explain you. Don't worry about that. And this is what standard deviation do. I'll explain you. Just observe now what I say. So I am opening Excel. Let's say I have a column like profit. So $100 is the profit. $321 is the profit. $864 is the profit. $9 is the profit. $21 is the forit. $87 is the forit. $34 is the profit. Okay. In this way, I have some values. I want to apply minmax scalar on this. Minmax scalar means all these values will be shrunk in the range 0 to 1 proportionately. So the highest number is 100. This will become one. The lowest number is 9. This will become zero. And rest all values will be somehow adjusted in the range 0 to 1. You know this is very similar to the you all might have seen this cartoon Alladan. Yes. So what is the specialtity of this genie? Where does this genie live? This genie lives inside the bottle. But how does the genie go inside the bottle? Inside the lamp, right? How does he go inside the lamp or the bottle or the lantern? By oh gas. Okay. And after becoming into gas, he comes inside and he becomes small. So this genie when he enters his home well he becomes so small. What is he doing? Right. Right from his pony till his tail, every part of his body is shrunk into a very very small U and everything is shrunk into a smaller region. Right? So he's proportionately squeezing his entire body in this range. Minmax scaler is same. It will take the entire data and squash it in the range 0 to 1. Let me show you the formula for that. That's the simple formula. Let's see what it says. It says that you find out the minimum and maximum of the column. Let me find it out. What is the minimum over here? So equal to minimum of this and equal to maximum of this. That's correct. Yes. Then how do I apply the formula? equal to x which is 100 minus minimum of x which is 9 bracket close divided by maximum minus minimum 864 minus 9 and yes I get this value I will you know because I don't want it as in when I drag it down see when I'm dragging it down I'm getting an error Because what happens is as I drag it down this 100 becomes 321 then 864 and so on but this 9 will shift down to this then again down and again down but there are no values so it's better I lock the cells how do I lock it using the dollar signs see the highest value is one lowest is zero rest all values are proportionately adjusted okay if I change this value let's say the profit is - $78 so this will become the lowest and everything will become shortened let's see you see that -78 become zero okay if this value I'm making it as the profit is 7866 see this is the highest value it become one rest all are adjusted so now imagine if profit column is converted proportionately in the range 0 to one then just like profit if you have any number of columns like in my case I have TV column I have radio column I have newspaper column all of this will get converted in the range 0 to one so every column will be treated the same by the machine learning model that is what I am doing also there is one more technique also there is one more technique which is called as standard scaler. So the standard scaler says I need mean and standard deviation. So I'll find out the mean as well. Mean is nothing but the average and standard deviation. So mean is the average formula of these all values. Bracket close and standard deviation is standard deviation of the population. This formula has to be used but that's okay. I mean that's not important. So standard scalar how does it work? equal to x minus mu brack and close divided by standard deviation. So I'll be locking this right now standard deviation does it in such a way that now if you actually look at the mean of these values, average of these all values it's zero. Now I'll explain you what I did. See what I did in standard deviation is how is this number computed? This is 100 minus mu is this 1513 divided by sigma which is 2695. I got minus 0.52. In this way all others are computed. Now what does standard deviation do? It will ensure that when you look at all these values the average of this will be zero. Now you'll be like but dash here it's not exactly zero. It's very close to zero but it's not zero because you have hardly six values. You take 600 values six lakh values it will exactly be zero. Okay. So both of these are good techniques for scaling. The first choice by data scientist is standard scaler. The second choice is minmax scaler. But right now I am going ahead with the minmax scaling. How do I do it? Well, it's so simple. You just have to Google for minmax scaler skarn. All the things related to machine learning are available in sky. Say let's scale using minmax scaling. That's the done. Where is it available? From skarn dot preprocessing import minmax scalar. I say from skalon dot pre-processing import minmax scalar. So what are we doing over here? We are importing the class minmax scalar. Then after that you have studied object oriented programming. You create an object of this class. So I am creating the object by the name mms. So I'm creating an object of the class minmax scaler. Then what will I say minmax scaler [clears throat] I want you to fit and transform over extra of features. If you forgot what are features let me just make you recolct. Features are this TV radio newspaper. So I'm saying minmax scaler I want you to fit and transform. Now fit means study the data and transform means apply the formula. So fit means study that column. So it will study TV column, radio column, newspaper column and transform is actually going to make those values in the range 0 to one. And once this transformation is done where to save the result I say save it back into the features. So now what happens over here is MMS object learns the formula from the training set and applies that formula on the training set. So now the learning is done. Okay. A student is there. I said that okay come prepared. I gave him question bank. He studied it. So learning is done. Now on the unseen data set which is the X test. So here on X test I am not fitting again because the formula is already learned from the training because the learning is done. and I only say transform this data because I want to see how much it is able to apply the knowledge. So this is something that you do in minmat scaling. So now if I just look at extendescribe you see the minimum value of TV radio newspaper is zero the maximum value is 1. What was earlier before scaling the minimum was 4 0 and.9 350 and 100 but now it is 0 and one. So it is just like the example of genie that we were able to shrink the values. The shrinking is important. We understand why is this shrinking important. Now what are we going to do is let's go ahead and build a linear regression model. So what are the steps to build a machine learning model? The first step is to import the model. This model is usually likely to be in the skarn library. Then next we create the object of the model or the object of the class right. So we import the class you know that could be better from a scalar. Then we create the object of a class and then after that we train the model and this train is also we ask the model to study right. So train is nothing but you ask the model to study the training data set. Technically you call it as fit. Similarly you test the model that is you ask it to predict. Yes. So we predict it and then we evaluate the model. And when it comes to evaluation we look at the R2 score method. we'll see what it is. So let's go and build the very first one which is the linear regression model. So step one is what? Import the class. I say from sklearn.linear model import linear regression. What am I googling for? I am looking for linear regression model. I am going to Google and I am typing linear regression skarn. I type every every algorithm you want. This is what you will type and this is the documentation. So you see over here skarn has a subclass which is called as linear model from which I'm going to get this class. So, sklearn has a sub package called as linear model from which I'll get the linear regression. Okay. Yeah. So, I say here then the next is step number two where we create the object of a class. So, I say LR is equal to linear regression. That object name can be anything. Step three is train or study and that is done using the fit method. So I'll say hey LR you go and fit on X train Y train which is the training data and after that what has happened is we had this data we divided it over here then we further divided it. So we all know that this is the training data and that's the training data. That's the testing data. So I ask my linear regression model to go and fit on the training data. So it will go and understand the relationship between X train Y train which is what we call as study. After this study is over the next thing what we are doing is now I'm asking my model now I'm asking my model to go and predict on this part. So when it predicts on this part I'll be getting set of answers. How do I call it? I say step four I am asking the model to go and predict on the training data. So y prediction on the train is LR. predict on X train. So that is Y pred trend. Okay. This this y predicted train is this. Similarly, I am asking the model that you also predict on unseen data that is you go and predict on this part. So that will be the prediction. So I say y bread test is equal to this. Then once that is over, okay, once that is over, we have to evaluate the model. How do you evaluate the model? Using R2 score. Where is this R2 score? Go to Google and you say R2 score. Skarn that's the documentation. What does it what does it ask for? It says I am inside skarn.metrics. Okay. So this link is copied. So it says I am inside sklearn. You give me Y true which is Y actual which is this and Y predicted which is this. So what am I doing? I am saying
Original Description
🔥Advanced Executive Program In Applied Generative AI - https://www.simplilearn.com/applied-generative-ai-course?utm_campaign=ReplaceWitha-8lVS8BCGs&utm_medium=DescriptionFirstFold&utm_source=Youtube
🔥Professional Certificate Course in Generative AI and Machine Learning - https://www.simplilearn.com/iitk-professional-certificate-course-ai-machine-learning?utm_campaign=ReplaceWitha-8lVS8BCGs&utm_medium=DescriptionFirstFold&utm_source=Youtube
️🔥 Michigan - Applied Generative AI Specialization - https://www.simplilearn.com/applied-ai-course?utm_campaign=ReplaceWitha-8lVS8BCGs&utm_medium=DescriptionFirstFold&utm_source=Youtube
🔥Professional Certificate Program in Generative AI and Machine Learning - IITG (India Only) - https://www.simplilearn.com/applied-generative-ai-course?utm_campaign=ReplaceWitha-8lVS8BCGs&utm_medium=DescriptionFirstFold&utm_source=Youtube
In this "Machine Learning Full Course" you will learn the full spectrum of Machine Learning, Deep Learning, and Artificial Intelligence with clear explanations and hands-on Python implementation. The course covers all major ML algorithms such as Linear Regression, Logistic Regression, Decision Trees, Random Forests, Naive Bayes, SVM, K Means, PCA, Gradient Boosting, and XGBoost. You will learn data preprocessing, feature engineering, model evaluation, and end-to-end workflows used by data scientists and machine learning engineers. Every concept is taught with practical coding in Python using NumPy, Pandas, Matplotlib, and Scikit Learn so you can build real ML models from scratch.
You will also explore Deep Learning and Neural Networks in depth, starting from perceptrons and activation functions to backpropagation and optimization methods. The course guides you through building neural networks with TensorFlow and Keras and then takes you into advanced architectures such as Convolutional Neural Networks for image tasks, Recurrent Neural Networks and LSTMs for sequence modeling, and practical deep learning pipe
Watch on YouTube ↗
(saves to browser)
Sign in to unlock AI tutor explanation · ⚡30
Playlist
Uploads from Simplilearn · Simplilearn · 0 of 60
← Previous
Next →
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
Ethical Hacking Full Course 2026 | Ethical Hacking Course for Beginners | Simplilearn
Simplilearn
AWS Full Course 2026 | AWS Cloud Computing Tutorial for Beginners | AWS Training | Simplilearn
Simplilearn
Data Structures And Algorithms Full Course | Data Structures and Algorithms Tutorial | Simplilearn
Simplilearn
SQL Full Course 2026 | SQL Tutorial for Beginners | SQL Beginner to Advanced Training | Simplilearn
Simplilearn
Microsoft Azure Full Course 2026 | Azure Tutorial for Beginners | Azure Training | Simplilearn
Simplilearn
Shopify Tutorial For Beginners 2026 | Shopify Course | shopify dropshipping | Simplilearn
Simplilearn
Six Sigma Full Course 2026 | Six Sigma Green Belt Training | Six Sigma Training | Simplilearn
Simplilearn
🔥Feeling Stuck? How Upskilling Can Boost Your Career! #shorts #simplilearn
Simplilearn
Growth Hacking In Marketing | Learn Growth Hacking Marketing Strategies | Simplilearn
Simplilearn
🔥Cracked 3 Job Offers with One AIML Course! | 20–30% Salary Hike #shorts #simplilearn
Simplilearn
Top 10 Must-Have Figma Plugins for UI/UX Designers in 2026 | Figma Plugins | Simplilearn
Simplilearn
Business Analytics Full Course 2026 | Business Analytics Tutorial For Beginners | Simplilearn
Simplilearn
Simplilearn Reviews | Getting future-ready with course in Artificial Intelligence | Roopam’s story
Simplilearn
Generative AI Full Course 2026 | Gen AI Tutorial for Beginners | Gen AI Explained | Simplilearn
Simplilearn
Full Stack Developer Course 2026 | Full Stack Java Developer Tutorial for Beginners | Simplilearn
Simplilearn
Simplilearn Reviews | How David Went From Seasoned Engineer to AI Innovator #GetCertifiedGetAhead
Simplilearn
Complete Social Media Marketing Strategy for 2026 | Social Media Marketing Strategy | Simplilearn
Simplilearn
🔥Top 4 Cybersecurity Certifications You Need! #simplilearn #shorts
Simplilearn
🔥Cloud Engineer Salary in India 2026 | City-Wise Breakdown #shorts #simplilearn
Simplilearn
Digital Marketing Full Course 2026 | Digital Marketing Tutorial For Beginners | Simplilearn
Simplilearn
Full Stack Java Developer Course | Full Stack Java Developer Tutorial for Beginners | Simplilearn
Simplilearn
Social Media Marketing Full Course | Social Media Marketing Tutorial For Beginners | Simplilearn
Simplilearn
How To Create LLM Chatbot Demo 2026 | Build a LLM Chatbot From Scratch | Simplilearn
Simplilearn
Digital Supply Chain Management Certification | Supply Chain Management Course | Simplilearn
Simplilearn
AI Agents Full Course 2026 | AI Agents Tutorial for Beginners | How to Build AI Agents | Simplilearn
Simplilearn
ITIL Full Course 2026 | ITIL 4 Foundation Course | ITIL Tutorial For Beginners | Simplilearn
Simplilearn
Generative AI Full Course 2026 | Gen AI Tutorial for Beginners | Gen AI Explained | Simplilearn
Simplilearn
ITIL Full Course 2026 | ITIL 4 Foundation Course | ITIL Tutorial For Beginners | Simplilearn
Simplilearn
Simplilearn Reviews | Integrating AI & Music | Diego's Story
Simplilearn
Digital Marketing Full Course 2026 | Digital Marketing Tutorial For Beginners | Simplilearn
Simplilearn
SEO Full Course 2026 | SEO Tutorial for Beginners | SEO Training | SEO Explained | Simplilearn
Simplilearn
PMP Vs CAPM: Which Certification Should You Choose? | PMP Vs CAPM | Simplilearn
Simplilearn
Complete Data Analyst Roadmap 2026 | How To Become A Data Analayst In 2026 | Simplilearn
Simplilearn
Generative AI Full Course 2026 | Gen AI Tutorial for Beginners | Gen AI Explained | Simplilearn
Simplilearn
🔥5 Jobs That Are Most Likely Safe from Layoffs in Today’s Market #shorts #simplilearn
Simplilearn
🔥Git vs GitHub – What's the Difference?
Simplilearn
What Goes Behind Building the Likes of Uber and Netflix? | Product Management Tutorial | Simplilearn
Simplilearn
AI Agents Full Course 2026 | AI Agents Tutorial for Beginners | How to Build AI Agents | Simplilearn
Simplilearn
Full Stack Developer Course 2026 | Full Stack Java Developer Tutorial for Beginners | Simplilearn
Simplilearn
Product Life Cycle 2025 | Stages Of Product Life Cycle | Product Life Cycle Tutorial | Simplilearn
Simplilearn
Project Management Full Course 2026 | Project Management Tutorial | PMP Course | Simplilearn
Simplilearn
PCB Design Course 2025 | PCB Designing Explained | How To Make PCBs | Simplilearn
Simplilearn
Python Full Course 2026 | Python Data Analytics Tutorial For Beginners | Simplilearn
Simplilearn
🔥Top Product Management Skills You Need to Succeed in 2026 #shorts #simplilearn
Simplilearn
SQL For Data Analytics 2026 | Essential SQL Commands | SQL Tutorial For Beginners | Simplilearn
Simplilearn
Simplilearn Reviews | Paving Way To Success With AI & ML Course | Soumik’s Upskilling Journey
Simplilearn
Six Sigma Full Course 2026 | Six Sigma Green Belt Training | Six Sigma Training | Simplilearn
Simplilearn
Learn Snowflake In 45 Mins | Snowflake Tutorial | What Is Snowflake | Snowflake Explained
Simplilearn
🔥ML Career Tip – How to Start Learning Machine Learning in 60 Seconds! #shorts#simplilearn
Simplilearn
🔥Agile vs Waterfall in 60 Seconds #shorts #simplilearn
Simplilearn
Excel Full Course 2026 | Excel Tutorial For Beginners | Microsoft Excel Course | Simplilearn
Simplilearn
What Are AI Agents? | Types Of AI Agents | AI Agents Explained | AI Agents Tutorial | Simplilearn
Simplilearn
How To Create a Product Roadmap In 2026 | Product Roadmap | What Is Product Roadmap | Simplilearn
Simplilearn
SQL Full Course 2026 | SQL Tutorial for Beginners | SQL Beginner to Advanced Training | Simplilearn
Simplilearn
🔥What Is Phishing? #shorts #simplilearn
Simplilearn
Cloud Computing Full Course 2026 | Cloud Computing Tutorial | Cloud Computing Course | Simplilearn
Simplilearn
Simplilearn Reviews | Overcoming Rejection & career plateau to finding a New Job : Bhaskar Banerji
Simplilearn
Six Sigma Full Course 2026 | Six Sigma Green Belt Training | Six Sigma Training | Simplilearn
Simplilearn
Generative AI Full Course 2026 | Gen AI Tutorial for Beginners | Gen AI Explained | Simplilearn
Simplilearn
VLSI Design Course 2026 | VLSI Tutorial For Beginners | VLSI Physical Design | Simplilearn
Simplilearn
More on: ML Pipelines
View skill →Related Reads
📰
📰
📰
📰
Help Choosing Neural Network Architecture for Matrix Classification
Reddit r/deeplearning
How to Choose the Best Deep Learning Model for Medical Imaging
Medium · Deep Learning
Another Way to Read Neural Geometry
Medium · Data Science
Another Way to Read Neural Geometry
Medium · Deep Learning
🎓
Tutor Explanation
DeepCamp AI