Feature scaling

Features can be on four scales as we covered in the introduction of this chapter. Models do not care about nominal features but are very sensitive to the scale of ratio or numerical features. In the house example, the house size and lot size are on a different scale, and that may make the model think that the lot size is more important than the house size, though the truth is quite the opposite. In a lot of real-life modeling scenarios, scale difference can be in hundreds, if not in thousands. 

There are different ways of doing feature scaling, such as the following:

  • Dividing a feature value with a maximum value, which will put every feature in the range
  • Dividing a feature value with the range, that is, maximum value-minimum value
  • Subtracting a feature value by its mean and then dividing by the range
  • Subtracting a feature value by its mean and then dividing by the standard deviation
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset