Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

why intercept is not calculated separately in Lasso_Regression_using_Coordinate_Descent.ipynb #2

Open
Sandy4321 opened this issue Jun 14, 2021 · 3 comments

Comments

@Sandy4321
Copy link
Author

same here
https://www.geeksforgeeks.org/implementation-of-lasso-regression-from-scratch-using-python/
db = - 2 * np.sum( self.Y - Y_pred ) / self.m

    # update weights

    self.b = self.b - self.learning_rate * db

@Sandy4321
Copy link
Author

here
https://github.com/llSourcell/linear_regression_live/blob/master/demo.py
the same
b_gradient += -(2/N) * (y - ((m_current * x) + b_current))
though
" + b_current"
is mistake

@Sandy4321
Copy link
Author

or sorry
(y - ((m_current * x) + b_current))
is ok

in any case in your code
derivative = 2 * np.dot(errors, feature)
from
https://github.com/wiqaaas/youtube/blob/master/Machine_Learning_from_Scratch/Ridge_Regression/Ridge_Regression_using_Gradient_Descent.ipynb

you use multiplication of errors by data
when others not

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant