-
-
Notifications
You must be signed in to change notification settings - Fork 25.9k
DOC: Add example to linear_model.PoissonRegressor #17453
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
Conversation
Is this still WIP or do you want reviews? |
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.
Thank you for the PR @nuka137 !
sklearn/linear_model/_glm/glm.py
Outdated
>>> clf.fit(X, y) | ||
PoissonRegressor(alpha=0.95) | ||
>>> print(clf.coef_) | ||
[0.30189415 0.30189415] |
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.
[0.30189415 0.30189415] | |
[0.301... 0.301...] |
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.
Thanks. I applied this format (also other results)
sklearn/linear_model/_glm/glm.py
Outdated
---------- | ||
>>> from sklearn import linear_model | ||
>>> clf = linear_model.PoissonRegressor(alpha=0.95) | ||
>>> X = [[0, 0], [1, 1], [2, 2]] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment 8000 to others. Learn more.
Can we have an example where the coef_
are different between the two features?
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.
Good idea.
I fixed it.
Thanks for your review! |
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.
Apply suggestion
Co-authored-by: Thomas J. Fan <thomasjpfan@gmail.com>
Thanks for your suggestion! Also, I noticed that |
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.
Thank you for the PR @nuka137 !
LGTM
* [WIP]: Add examples to linear_model.PoissonRegressor * Address review * Address review * Apply suggestions from code review Co-authored-by: Thomas J. Fan <thomasjpfan@gmail.com> * Remove numpy import Co-authored-by: Thomas J. Fan <thomasjpfan@gmail.com>
* [WIP]: Add examples to linear_model.PoissonRegressor * Address review * Address review * Apply suggestions from code review Co-authored-by: Thomas J. Fan <thomasjpfan@gmail.com> * Remove numpy import Co-authored-by: Thomas J. Fan <thomasjpfan@gmail.com>
Reference Issues/PRs
Relates to #3846
What does this implement/fix? Explain your changes.
Add example to
linear_model.PoissonRegressor
.