From the course: MySQL for Advanced Analytics: Tips, Tricks, & Techniques

Unlock the full course today

Join today to access over 22,500 courses taught by industry experts or purchase this course individually.

Centering and scaling

Centering and scaling - MySQL Tutorial

From the course: MySQL for Advanced Analytics: Tips, Tricks, & Techniques

Start my 1-month free trial

Centering and scaling

- [Instructor] Centering and scaling is a data preprocessing technique used to normalize continuous variables to be in the same range before they can be used for machine learning. To center and scale, you subtract the mean of a column from the column value and then divide it by a standard deviation. I will now show you how to do centering and scaling in my SQL. For this I am gonna first open the exercise file, Centering_and_Scaling. In this example, we will center and scale two columns, duration and age. First, you need to find out the mean and standard deviation for these columns and store them in session variables. This is done in the first SQL from line six to line 10. As you can see, we use commands, average and standard deviation, to compute this average and standard deviation for duration and age and store them in memory variables. Let us first execute this command. You can see in the results that these are computed and stored in memory. Next, we will do actual centering and…

Contents