Why Do We Need to Perform Feature Scaling?

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
  • Original Title: Why Do We Need to Perform Feature Scaling?
  • Author: Krish Naik
  • Description: Hello All, In this video we will be understanding why do we need to perform Feature Scaling. Happy Learning!! amazon url: ...
  • Youtube URL: https://www.youtube.com/watch?v=nmBqnKSSKfM
👍︎︎ 1 👤︎︎ u/aivideos 📅︎︎ Sep 24 2019 🗫︎ replies
Captions
hello all my name is Krishna and welcome to my youtube channel today we will be discussing why do we require feature scaling whenever we are solving any machine learning use case or deep learning use case why do we require to perform feature scaling with respect to the data set that we have so remember guys whenever we are discussing about feature scaling that basically means we are discussing about features right now suppose let me consider that in my data set I have features like height okay I have features like weight and suppose based on this right I want to predict what is my body mass index suppose my DMI okay now suppose in this case what did not happen that my height and weight are basically my independent features and I BMI is basically my dependent feature suppose this understating as an example remember guys every feature has two things okay one is I mean I'm just talking about the values inside this okay whenever I am talking about this particular values this values has two things one is it is represented by magnitudes and then it is represented by units okay because we will be using these features will be actually recording this observation based on the magnitudes and units now if I take an example of height and computing hide by centimeters suppose I'm computing it okay so this centimeters is basically my units and the value inside this height is basically my magnitude so it may be 180 centimeters 170 centimeters so this value is basically magnitude right now similarly if I take weight my unit may be kg okay because that is how we actually calculate weights then if I want to put some values like 78 it may be 84 okay and these are my magnitudes now if we don't perform feature scaling what may happen in this scenario is that some of the machine learning algorithms okay well this is about some of the machine learning algorithm where we have to compulsorily do feature scaling now if I am going to take this particular magnitude values and try to apply in some machine learning algorithm just let me take an X like a nearest neighbor now you know that K nearest neighbor works on Euclidean distance okay now remember if I take the same magnitude and if I try to plot this in a two dimensional graph right so this point you may be very very it may have varies like when I distances and the distances will be huge because here I am basically going to use Euclidean distance so what we have to do is that we have to scale down this value nice we have to scale down these values in such a way that each and every feature that we have will try to perform some some type of scaling techniques I have already discussed what are the different types of feature scaling in my previous videos but we are just trying to understand why feature scaling is required understand that is this value differ a lot okay and when we are using some of their gardens like KNN where the Euclidean distance is very important and that Euclidean distance is computed based on this particular magnitude of the value so we should try to perform scaling and we should try to scale down these features and not scaling also happens with respect to that specific features only so suppose I find scaling this between 0 to 1 ok I may call it as a uniform scaling or min/max scaling and also called I may also scale this based on the standard normal distribution I I'll call it a standard scalar standard scale of scaling so all the different types of scaling are there if you have not seen that video please go and watch watch that particular video different types of scaling techniques now let me just make you sure why we require scaling and which our algorithm will be requiring scale and it is always necessary that we perform scaling in those algorithms so the first algorithm that I would like to consider is your linear regression now remember guys in linear regression this basically works and the coefficients in linear regression is basically found out with the help of gradient descent with the help of gradient descent and always remember my values of my you know the coefficient should be able to converge it this particular global minima it should be converging in this global minimum now remember if we perform scaling then it means it may happen in such a way that already the initial randomly initialized coefficient may be very very near to the global minimum if I don't scale it then it may have been in such a scenario that my random initially point of the coefficient may be far away okay but always remember if you scale down this value how convergence will happen quickly okay how convergence will basically happen quickly when we are performing scaling in case of linear regression now always remember after this suppose if we have some of the machine learning algorithms both in supervised and unsupervised technique wherein we are specifically using Euclidean distance okay like k-means clustering like k nearest neighbor right so in this kind of algorithms will use Euclidean distance and again remember that if we don't scale down this value what may happen will be having a huge distance over there so we should try to scale down that value and try to perform and try to get this feature scaled in this gaming's okay so that our algorithm will run very very faster okay and always remember guys this particular technique this is an unsupervised technique k-means clustering it may be hard coming clustering so wherever whichever algorithm this kind of stuff is there where in you you have the gradient descent concept all you have Euclidean distance concept at that and you should basically prefer using feature skinny okay and similarly this applies to deep learning also now you know that you need each and every deep learning technique gradient descent will come into picture right so there it is very very much compulsory and talking about both CN n al n or RN n it is very very much compulsory to do the feature scale now for CN n where your inputs are basically images the type of scaling that is basically applied is called as unit scaling wherein your pixels between 0 to 255 for that particular images will be converted between 0 to 1 okay and that is basically called as units feeling and so this was the basic things about this but when should we not apply feature stealing that is also very very important right so I'd like to specify some of the algorithms where you don't have to use feature scaling and it is not necessary because if you perform feature scaling then it is not going to make such impact so some of the algorithms like decision tree random forest HD boost so these are basically my n symbol techniques right in all these techniques you don't have to use feature scaling guys because it's understand decision trees will just be creating trees right based on the features based on these features so if you scale down this value it is not going to make that particular impact because the number of branches will be almost same whether you do the scaling whether you don't do the scaling so you do not have to perform and you know that random forest is also an in symbol technique and within that you will also be using decision tree similarly in the case of HG boost so you don't have to perform specifically some feature scaling in this particular case let it be a regression problem let it be a classification problem so high hope you've got a basic idea why and when to perform feature scaling what are the necessary conditions which all algorithms will prefer performing feature scaling oh that's all about this particular video please do subscribe to channel guys if you have not already subscribed I'll see you in the next video have a great day thank you
Info
Channel: Krish Naik
Views: 69,256
Rating: 4.9013538 out of 5
Keywords: feature scaling python, feature scaling example, feature scaling, normalization vs standardization machine learning, what is the maximum value for feature scaling, data scaling and normalization in machine learning, keras feature scaling, feature scaling normal equation
Id: nmBqnKSSKfM
Channel Id: undefined
Length: 8min 0sec (480 seconds)
Published: Thu Aug 15 2019
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.