Skip to content

DOC: Add example to linear_model.PoissonRegressor#17453

Merged
thomasjpfan merged 5 commits intoscikit-learn:masterfrom
nuka137:doc-linear-model
Jun 7, 2020
Merged

DOC: Add example to linear_model.PoissonRegressor#17453
thomasjpfan merged 5 commits intoscikit-learn:masterfrom
nuka137:doc-linear-model

Conversation

@nuka137
Copy link
Copy Markdown
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
Copy Markdown
Member

amueller commented Jun 6, 2020

Is this still WIP or do you want reviews?

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can we have an example where the coef_ are different between the two features?

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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