8000 DOC: Add example to linear_model.PoissonRegressor by nuka137 · Pull Request #17453 · scikit-learn/scikit-learn · GitHub
[go: up one dir, main page]

Skip to content

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

Merged
merged 5 commits into from
Jun 7, 2020
Merged

DOC: Add example to linear_model.PoissonRegressor #17453

merged 5 commits into from
Jun 7, 2020

Conversation

nuka137
Copy link
Contributor
@nuka137 nuka137 commented Jun 5, 2020

Reference Issues/PRs

Relates to #3846

What does this implement/fix? Explain your changes.

Add example to linear_model.PoissonRegressor.

@amueller
Copy link
Member
amueller commented Jun 6, 2020

Is this still WIP or do you want reviews?

Copy link
Member
@thomasjpfan thomasjpfan left a 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 !

>>> clf.fit(X, y)
PoissonRegressor(alpha=0.95)
>>> print(clf.coef_)
[0.30189415 0.30189415]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
[0.30189415 0.30189415]
[0.301... 0.301...]

Copy link
Contributor Author

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)

----------
>>> from sklearn import linear_model
>>> clf = linear_model.PoissonRegressor(alpha=0.95)
>>> X = [[0, 0], [1, 1], [2, 2]]
Copy link
Member

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?

Copy link
Contributor Author

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.

@nuka137 nuka137 changed the title [WIP]: Add example to linear_model.PoissonRegressor DOC: Add example to linear_model.PoissonRegressor Jun 7, 2020
@nuka137
Copy link
Contributor Author
nuka137 commented Jun 7, 2020

@amueller @thomasjpfan

Thanks for your review!
Sorry, I had been worked this to improve the example until now.
I finished the improvement, so I removed WIP.

Copy link
Contributor Author
@nuka137 nuka137 left a 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>
@nuka137
Copy link
Contributor Author
nuka137 commented Jun 7, 2020

@thomasjpfan

Thanks for your suggestion!
I applied your suggestions and worked correctly in my environment.

Also, I noticed that import numpy as np is not needed any more.
So I removed this line.

Copy link
Member
@thomasjpfan thomasjpfan left a 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

@thomasjpfan thomasjpfan merged commit 74b445e into scikit-learn:master Jun 7, 2020
@nuka137 nuka137 deleted the doc-linear-model branch June 7, 2020 05:19
viclafargue pushed a commit to viclafargue/scikit-learn that referenced this pull request Jun 26, 2020
* [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>
jayzed82 pushed a commit to jayzed82/scikit-learn that referenced this pull request Oct 22, 2020
* [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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0