-
-
Notifications
You must be signed in to change notification settings - Fork 25.9k
DOC - Specify penalty in GammaRegressor
documentation
#24789
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
sklearn/linear_model/_glm/glm.py
Outdated
|
||
This regressor uses the 'log' link function. | ||
Its optimization objective is | ||
|
||
.. math:: |
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.
For refs, check:
GammaRegressor
documentationGammaRegressor
documentation
sklearn/linear_model/_glm/glm.py
Outdated
Its optimization objective is:: | ||
|
||
sum(Xw_i + y_i * exp(-Xw_i) - log(y_i) - 1) | ||
+ (1/2) * alpha ||w||_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 to others. Learn more.
I am still not sure that we want to have the formulation here.
@lorentzenchr What is your feeling about it? If we start to introduce the objective function here, then we probably want to do the same for the other GLM.
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.
I personally like the objective as part of the docstring, but we often only have them in the user guide, examples: LogisticRegression
, PoissonRegressor
, GammaRegressor
.
In case we include them in the docstring, having them as
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.
Cons: It could be considered as implementation detail. It bloats the docstring. We would have it in 2 places, user guide and docstring.
Pros: Without objective, one does not know what the model does. Only the exact objective enables to compare with other libraries.
GammaRegressor
documentationGammaRegressor
documentation
I agree with you @glemaitre on #24789 (comment), better not to add the objective function expression in this place. I removed it and kept the details about the penalty term and the doc formatting. |
Thanks @Badr-MOUFAD LGTM. |
Reference Issues/PRs
Not linked to any exiting issue or PR.
What does this implement/fix? Explain your changes.
This fixes
GammaRegressor
documentation. In particular:Any other comments?
No.