You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
etc.
I think it would be nice to make all the files that are not the canonical import (according to the API documentation) private (with deprecation obviously).
That might be a bit annoying for existing users that used long import paths, but it makes auto-complete much more helpful and the module structure much less confusing for newcomers.
For example sklearn.linear_model.ridge is a module, while sklearn.linear_model.ridge_regression is a function that implements ridge regression and sklearn.linear_model.Ridge is a class that implements ridge regression. From the names this is totally unclear.
I would support this as it seems like it could clear up a lot of confusion. Do you believe there are any people directly trying to use the functions that would be made private?
I am certain that there is code importing from the submodules, but
deprecation is fine. we might need to pay attention to whether or not base
class implementations get imported into the public modules
Since #14939 is merged, we seem to be deprecating them already for 0.22. This now seems like an easy one for some of the upcoming sprints. Although if we want it done before the end of october, we should do it ourselves maybe.
pretty sure folks have not been using git move correctly. Try doing a single commit that does the move and commit that, before adding anything else. Your PRs don't show files as moved, which means that something went wrong.
@thomasjpfan From the list, I only did not review the PR for the decomposition. I did not open a PR because you seem to have work on it. Could you open a PR?
you can import from sklearn.datasets._base import ...
However, now you are aware that _base will be private and you might have to change your code at a new scikit-learn release since we might not provide backward-compatible code.
This said, be aware that we are going to define a developer API which will define some backward support for these types of utilities used in third-party.
Activity
jmschrei commentedon Jun 29, 2017
I would support this as it seems like it could clear up a lot of confusion. Do you believe there are any people directly trying to use the functions that would be made private?
jnothman commentedon Jun 29, 2017
adrinjalali commentedon Sep 10, 2019
Since #14939 is merged, we seem to be deprecating them already for 0.22. This now seems like an easy one for some of the upcoming sprints. Although if we want it done before the end of october, we should do it ourselves maybe.
NicolasHug commentedon Sep 10, 2019
Below is the list of the folders whose files need to be preceded by an underscore. The procedure is pretty straightforward:
file.pyinto_file.pyand create a newfile.pywith a similar content that raises a deprecation warning (likeneural_network/rbm.py)__init__.pysklearn/tests/test_import_deprecations.pyFolders
(Note that this only addresses the folders. Files like
sklearn/pipeline.pymay still contain non-deprecated things.)NicolasHug commentedon Sep 10, 2019
ping @thomasjpfan @glemaitre @adrinjalali let's pick one each and review each-other? this should go relatively fast
I'll pick
clusteradrinjalali commentedon Sep 11, 2019
I'm taking the
treeandensemble, since they're interrelated.glemaitre commentedon Sep 12, 2019
I'll take
preprocessingandinspectionat firstamueller commentedon Sep 18, 2019
pretty sure folks have not been using
git movecorrectly. Try doing a single commit that does the move and commit that, before adding anything else. Your PRs don't show files as moved, which means that something went wrong.jnothman commentedon Sep 18, 2019
adrinjalali commentedon Sep 19, 2019
I did move, as you see in this commit df7f54d but once you create a file with the same name, github gets confused.
NicolasHug commentedon Oct 9, 2019
I'm working on
mixtureandsvm10 remaining items
thomasjpfan commentedon Oct 21, 2019
Working on inspection
thomasjpfan commentedon Oct 21, 2019
Working on preprocessing
thomasjpfan commentedon Oct 21, 2019
Working on linear_models
glemaitre commentedon Oct 23, 2019
@thomasjpfan From the list, I only did not review the PR for the decomposition. I did not open a PR because you seem to have work on it. Could you open a PR?
qinhanmin2014 commentedon Oct 28, 2019
ping @NicolasHug @thomasjpfan what about sklearn.feature_selection?
Is #15367 a blocker?
thomasjpfan commentedon Oct 28, 2019
Working on feature_selection
NicolasHug commentedon Oct 28, 2019
Thanks I missed this one
Yes but it's tracked by another issue
lucasdavid commentedon Dec 23, 2019
I had a ton of private datasets, such as names, text and geographical data. I used to use the following utils to download and manage these:
What's the recommended approach now?
glemaitre commentedon Dec 23, 2019
you can import
from sklearn.datasets._base import ...However, now you are aware that
_basewill be private and you might have to change your code at a new scikit-learn release since we might not provide backward-compatible code.This said, be aware that we are going to define a developer API which will define some backward support for these types of utilities used in third-party.
WIP: Add support for scikit-learn 0.22
Add support for scikit-learn 0.22
Add support for scikit-learn 0.22
Add support for scikit-learn 0.22