-
-
Notifications
You must be signed in to change notification settings - Fork 25.8k
[MRG + 1] deprecated randomized_l1 #9031
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
@agramfort I'm not sure how the deprecation should be done, I added warning at the top of the file that is deprecated. @GaelVaroquaux asked me a gist of the code that has been removed, but I didn't remove any for now, rather in the warning message, said it would be removed in the next release |
@Sentient07 read this http://scikit-learn.org/stable/developers/contributing.html#deprecation you'll also need to remove reference to this code in narrative documentation |
see cross_validation for another case of module-level deprecation
…On 7 Jun 2017 5:59 pm, "Alexandre Gramfort" ***@***.***> wrote:
@Sentient07 <https://github.com/sentient07> read this
http://scikit-learn.org/stable/developers/contributing.html#deprecation
you'll also need to remove reference to this code in narrative
documentation
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#9031 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAEz64zx1fUkMt-z0S65sFRGxoUoyLt5ks5sBlhogaJpZM4NyVKr>
.
|
Sorry, had a long day of work and travel couldn't get back earlier. I had removed the deprecated module's code from the example section and specified the versions in which this module will be deprecated and removed. |
@Sentient07 there should be no warning when running the test of building the doc |
since you won't remove the tests now it means you need to capture the warnings |
Understood. But is it preferred to remove the tests ? ( cross_validation still seems to have its test, but raising warnings when the module is trying to be imported) |
Also, should I get rid of the |
keep the tests but capture warning
and remove examples and narrative doc about it
|
@agramfort I have caught and ignored the warnings in test. I tested with |
narrative documentation is basically anything in doc/
On 8 Jun 2017 11:45 pm, "Ramana Subramanyam" <notifications@github.com> wrote:
@agramfort <https://github.com/agramfort> I have caught and ignored the
warnings in test. I test with no-capture option and I don't see any
warning. Also, I have removed the example and the related documentation. (I
am not very sure what is narrative documentation)
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#9031 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAEz6zI2ONvSN0fEovb7sez-OPY-hb6Eks5sB_r4gaJpZM4NyVKr>
.
|
flake8 failures:
|
Sorry about the flake8 errors, I have fixed that and squashed the commits into one. |
It seems I misled you. We shouldn't be doing a module deprecation like for
cross_validation. That's done where people import the model directly. We
should be deprecating each of the public objects in the module, like at
sklearn/mixture/gmm.py. Apologies.
…On 15 June 2017 at 09:38, Ramana Subramanyam ***@***.***> wrote:
Sorry about the flake8 errors, I have fixed that and squashed the commits
into one.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#9031 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAEz6-NHJP2QcoghIufVrn_4SjdG1deTks5sEG7mgaJpZM4NyVKr>
.
|
No problem, I will do the changes tomorrow. |
@Sentient07 are you still on this? Usually I wouldn't be nagging, but we're trying to move towards a release ;) |
Will send a PR by tonight! Sorry, was having a deadline and couldn't find
time before :(
…On 19 Jun 2017 9:38 pm, "Andreas Mueller" ***@***.***> wrote:
@Sentient07 <https://github.com/sentient07> are you still on this?
Usually I wouldn't be nagging, but we're trying to move towards a release ;)
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#9031 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AF6IcFqIzCI83YR2bSd1ebGPnzODCkWoks5sFpzwgaJpZM4NyVKr>
.
|
@amueller sorry for the delay, I made the deprecation similar to GMM, fixed the merge conflict. |
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.
Looks good, but you need to fix the flake8 errors for travis to pass. Also, can you please add a test that checks that a warning is actually raised when instantiating an object of the class with assert_warns_message
? Thanks!
sklearn/linear_model/__init__.py
Outdated
from .randomized_l1 import (RandomizedLasso, RandomizedLogisticRegression, | ||
lasso_stability_path) | ||
|
||
with warnings.catch_warnings(): |
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 don't need to catch here, importing will not raise a deprecation warning
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.
Ah! Forgot to remove
Oh also please add an entry to whats_new.rst |
@amueller I made the changes that you suggested. I did not test it locally as after the recent rebase, I am getting stuck with this error, |
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.
And if you otherwise think your work here is complete and want a full review, change the title's WIP to MRG.
sklearn/linear_model/__init__.py
Outdated
@@ -30,8 +30,7 @@ | |||
from .passive_aggressive import PassiveAggressiveClassifier | |||
from .passive_aggressive import PassiveAggressiveRegressor | |||
from .perceptron import Perceptron | |||
from .randomized_l1 import (RandomizedLasso, RandomizedLogisticRegression, |
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.
We still need this. It is the source of test failures.
@Sentient07, this is a blocker issue. |
I had pushed a commit before and it didn't get updated here. I have pushed it again. Once Travis passes, I'll change it to |
doc/whats_new.rst
Outdated
@@ -1279,6 +1279,9 @@ Model evaluation and meta-estimators | |||
the parameter ``n_labels`` is renamed to ``n_groups``. | |||
:issue:`6660` by `Raghav RV`_. | |||
|
|||
- The :mod:`sklearn.linear_model.randomized_l1` is deprecated. | |||
:issue: `8995` by `Andreas Mueller`_. |
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.
The "by" refers to the contributor, so you. You can use the :user:
pattern as elsewhere in whatsnew.
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.
There should be a list of deprecated functions in 0.19 in the whatsnew.
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.
LGTM apart from whatsnew nitpicks.
@@ -30,8 +30,10 @@ | |||
from .passive_aggressive import PassiveAggressiveClassifier | |||
from .passive_aggressive import PassiveAggressiveRegressor | |||
from .perceptron import Perceptron | |||
|
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.
why 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.
Probably when I added code for catching the exception at the time of import, after removing it, this empty line came up
@@ -58,6 +60,8 @@ def _resample_model(estimator_func, X, y, scaling=.5, n_resampling=200, | |||
return scores_ | |||
|
|||
|
|||
@deprecated("The class BaseRandomizedLinearModel is deprecated in 0.19" |
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.
Hm this should not have been public, but given that it was, deprecating it is the right thing to do.
doc/whats_new.rst
Outdated
@@ -1279,6 +1279,9 @@ Model evaluation and meta-estimators | |||
the parameter ``n_labels`` is renamed to ``n_groups``. | |||
:issue:`6660` by `Raghav RV`_. | |||
|
|||
- The :mod:`sklearn.linear_model.randomized_l1` is deprecated. | |||
:issue: `8995` by `Andreas Mueller`_. |
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.
There should be a list of deprecated functions in 0.19 in the whatsnew.
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.
LGTM as well once @amueller's comments are addressed.
Removed the deprecated module's code from examples Added warning removed from narrative documentation fixed flake8 Changed deprecation style to GMM Added tests and fixed flake8 Added removed code and updated whats_new Modified whatsnew
Addressed comments, squashed into one commit |
The CI errors are all cause by mldata.org 500 errors. Merging. |
Thanks @Sentient07! |
This PR attempts to fix #8995