-
-
Notifications
You must be signed in to change notification settings - Fork 46.6k
Update linear_regression.py #11567
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
base: master
Are you sure you want to change the base?
Update linear_regression.py #11567
Conversation
add error handling function. it can handle errors and still run the linear regression algorithm.
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
Please review the pull request and merge it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let me know what exactly you are trying to change or enhance for ??
i am trying enhancing the code's robustness by adding error handling to prevent crashes during key operations like dataset fetching, gradient descent, and error calculations. Specifically, i am ensuring that network issues, matrix operations, and computational errors don't disrupt the linear regression process, providing useful debugging messages instead. |
Can you merge my pull request by reviewing the PR. |
pls merge the this for following issue Create error handling function in linear regression algorithm of ML #11534 |
add error handling function. it can handle errors and still run the linear regression algorithm.
Describe your change:
Added try-except blocks for network errors while fetching the dataset (requests.exceptions.RequestException).
Added error handling for gradient descent and sum of square error calculations to avoid crashing during matrix operations.
Ensured that the main function can handle unexpected issues during the linear regression process and print useful debugging messages.
Checklist: