Hi, I have a question on the answer for the 6. Fitting a linear regression NN in Representing Neural Networks module.
Since bias column is already in the features data frame, I believe lr
should be constructed with fit_intercept = False option.
Here’s the code from the answer:
def train(features, labels):
lr = SGDRegressor()
lr.fit(features, labels)
weights = lr.coef_
return weights
if the intercept in lr is printed, it can be checked that the intercept is a non-zero term, which is not desirable