Dividing the weights obtained on an already standardized data set by the standard deviation of the features? (Ridge regression)
I found my answer myself.. I'm not sure if I should delete the question, so I'll just share: 

Say for a given data point before normalising we have
a*x + b*z =  y Normalising makes this a * x/std(x) + b * z/std(z) = y This means that for standard deviations greater than 1 the features are shrunk and therefore the weights are blown up. In the code the y_hat values are obtained using the original data, which means the coefficients have to be shrunk to reflect the relationship between the output and the original feature values.