DOC: Add example to linear_model.PoissonRegressor#17453
DOC: Add example to linear_model.PoissonRegressor#17453thomasjpfan merged 5 commits intoscikit-learn:masterfrom nuka137:doc-linear-model
Conversation
|
Is this still WIP or do you want reviews? |
thomasjpfan
left a comment
There was a problem hiding this comment.
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.
| [0.30189415 0.30189415] | |
| [0.301... 0.301...] |
There was a problem hiding this comment.
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.
Can we have an example where the coef_ are different between the two features?
There was a problem hiding this comment.
Good idea.
I fixed it.
|
Thanks for your review! |
Co-authored-by: Thomas J. Fan <thomasjpfan@gmail.com>
|
Thanks for your suggestion! Also, I noticed that |
thomasjpfan
left a comment
There was a problem hiding this comment.
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.