Fwb(x)= wx + b : Advice for selecting scalar value for b term


The “b” bias parameter in the regression function (fwb(x)= wx + b) is the y-intercept value when x =0. This may seem like an obvious question, but how do you decide what scalar value to use to initialize b? My intuition is that the problem and data set should give you some guidance; however, in the housing price examples in the videos and labs, init_b has ranged in values from 0 to close to 600. As such I’m unclear on how to decide on the most appropriate init_b value. For example, if the features are normalized, then does it make sense to set init_b to 0?

Thank you in advance for your advice!


Since the linear regression cost function is convex, it doesn’t matter very much what the initial values are. There is only one minimum to be found.

Since there isn’t much to go by with regard to making an intelligent guess, typically we just set the initial values to all-zeros.


Thank you TMosh, I’ve read a few of your other posts and your responses are always concise and clear.