-
-
Save rvndbalaji/f08bd39bdf0f0e70ce17b1b0ff6d6a41 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Feature Scaling & Mean Normalization | |
#This function is EXACTLY equivalent to the scale() function in R | |
//Remember to exclude the last column of the data, we should not normalize what we predict. | |
room_n = scale(room[1:5]) | |
//Or all this function | |
normalize = function(x) | |
{ | |
return ((x - mean(x))/sd(x)) | |
} | |
#Merge the last column after normalizing, which we initially excluded. | |
room_n = cbind(room_n,room[6]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment