-
-
Notifications
You must be signed in to change notification settings - Fork 26k
[MRG+1] DOC adding a warning on the relation between C and alpha #7860
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
@jnothman Could you please help me understand why circleci is giving an error and maybe provide a review of my changes? |
I've requested a rebuild. Let's see if that's enough. |
All green from the CI's perspective. Is this still WIP? WIP means you're not really ready for review yet. |
Sorry was stuck in class! Ready for review I suppose. |
@@ -266,6 +266,11 @@ They also tend to break when the problem is badly conditioned | |||
|
|||
* :ref:`sphx_glr_auto_examples_linear_model_plot_lasso_model_selection.py` | |||
|
|||
.. note:: **Comparison with the regularization parameter of SVM** |
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.
wouldn't it be better to mention that directly after alpha is introduces? Also, there are only two possiblities, right? alpha = 1/C or alpha = n_samples / C?
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 think @amueller is saying that the current description here is not specific enough, or not very helpful to the reader.
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 for clearing it up. Yes, I should add that only 2 variances of C exist (with respect to alpha). As per the positioning, I felt that since this could be critical to getting a correct result, it should be mentioned separately to draw more attention as it's importance could really be overlooked when mentioned under the same heading .
Also, I felt it was better that readers first understand what alpha does, so that they can make sense of what we are trying to add. I also had a suggestion that we link the issue there because at first I didn't know about this discontinuity but reading the comments on the thread made it clear for me, which could easily be the case with any new contributor.
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.
Added the change mentioning the two values of C, but am skeptical about mentioning it at the top. Please let me know what you feel.
equivalence between the amount of regularization of two models depends on | ||
the exact objective function optimized by the model. For example, when the | ||
estimator used is ``Ridge Regression``, the relation between both is given as | ||
:math:`C = \frac{n\_samples}{alpha}`. |
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.
It should be \frac{1}{alpha}
regularization parameter, most other estimators use ``alpha``. The exact | ||
equivalence between the amount of regularization of two models depends on | ||
the exact objective function optimized by the model. For example, when the | ||
estimator used is ``Ridge Regression``, the relation between both is given 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.
estimator used is :class:`Ridge` regression, the relation between both is given 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.
"between both" -> "between them"
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 for the review, making the change.
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.
otherwise LGTM
regularization parameter, most other estimators use ``alpha``. The exact | ||
equivalence between the amount of regularization of two models depends on | ||
the exact objective function optimized by the model. For example, when the | ||
estimator used is :class:`Ridge` regression, the relation between them is given 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.
you need to qualify the reference to ridge with linear_model.
or maybe even sklearn.linear_model.
@jnothman Please have a look now. |
regularization parameter, most other estimators use ``alpha``. The exact | ||
equivalence between the amount of regularization of two models depends on | ||
the exact objective function optimized by the model. For example, when the | ||
estimator used is :class:`sklearn.linear_model.Ridge` regression, the relation between them is given 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.
would look better as
:class:`sklearn.linear_model.Ridge <ridge>`
but the link works at least
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.
Actually, I was referencing how GridSearchCV
is being. I thought it would be good to follow the common pattern of how the links are being inserted.
Proper choice of ``C`` and ``gamma`` is critical to the SVM's performance. One
is advised to use :class:`sklearn.model_selection.GridSearchCV` with
``C`` and ``gamma`` spaced exponentially far apart to choose good values.
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.
Yes, except that here "used is Ridge regression" is a syntactic use of "ridge" not just a mention of the estimator.
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 for clearing it up! I'll make the change then.
regularization parameter, most other estimators use ``alpha``. The exact | ||
equivalence between the amount of regularization of two models depends on | ||
the exact objective function optimized by the model. For example, when the | ||
estimator used is :class:`sklearn.linear_model.Ridge <ridge>` regression, the relation between them is given 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.
mind your line length, please
I was looking to check if the link's working but for some reason, CircleCI is not showing the built artifact. |
@jnothman Please let me know if there is anything I need to change. Thanks. |
I've marked this as LGTM, but - although sometimes one approval suffices for simple documentation changes - I'd appreciate the review of another core dev. |
This looks good to me |
…kit-learn#7860) * DOC adding a warning on the relation between C and alpha * DOC removing extra character * DOC: changes to the relation described * DOC fixing typo * DOC fixing typo * DOC fixing link to Ridge * DOC link enhancement * DOC fixing line length
…kit-learn#7860) * DOC adding a warning on the relation between C and alpha * DOC removing extra character * DOC: changes to the relation described * DOC fixing typo * DOC fixing typo * DOC fixing link to Ridge * DOC link enhancement * DOC fixing line length
…kit-learn#7860) * DOC adding a warning on the relation between C and alpha * DOC removing extra character * DOC: changes to the relation described * DOC fixing typo * DOC fixing typo * DOC fixing link to Ridge * DOC link enhancement * DOC fixing line length
…kit-learn#7860) * DOC adding a warning on the relation between C and alpha * DOC removing extra character * DOC: changes to the relation described * DOC fixing typo * DOC fixing typo * DOC fixing link to Ridge * DOC link enhancement * DOC fixing line length
…kit-learn#7860) * DOC adding a warning on the relation between C and alpha * DOC removing extra character * DOC: changes to the relation described * DOC fixing typo * DOC fixing typo * DOC fixing link to Ridge * DOC link enhancement * DOC fixing line length
Reference Issue
Fixes #6919
What does this implement/fix? Explain your changes.
Added the note on varying equivalence between C and alpha depending on the estimator. Also, made a note in the linear models module warning about this dependence.