Connect your moderator Slack workspace to receive post notifications:
Sign in with Slack

Do we have to add the offset while implementing logistic regression and regularized logistic regression?

In the lab template, there is a line adding offset to tx matrix in the logistic regression and the regularized logistic regression:

 tx = np.c_[np.ones((y.shape[0], 1)), x]

Do we have to add this offset while implementing logistic regression and regularized logistic regression in project 1?
Also, do we have to add the offset to other four functions?

Thanks!

It is okay to similarly add
tx = np.c_[np.ones((y.shape[0], 1)), x]
as a preprocessing step for your data matrix tx and then use generic logistic / least-squares functions (without any changes inside them) on the extended data matrix.

Page 1 of 1

Add comment

Post as Anonymous Dont send out notification