Handling Numerical Data using StandardScaler

In real life, values in a dataset might have a variety of different magnitudes, ranges, or scales.

Algorithms that use distance as a parameter may not weigh all these in the same way. There are various data transformation techniques that are used to transform the features of our data so that they use the same scale, magnitude, or range. This ensures that each feature has an appropriate effect on a model’s predictions. Some features in our data might have high-magnitude values (for example, annual salary), while others might have relatively low values (for example, the number of years worked at a company). Just because some data has smaller values does not mean it is less significant.

So, to make sure our prediction does not vary because of different magnitudes of features in our data, we can perform

1. feature scaling,
2. standardization, or
3. normalization (these are three similar ways of dealing with magnitude issues in data).

There are 2 types of scaling:

1. Standard Scalar Method
2. MinMax Scalar Method