-
-
Notifications
You must be signed in to change notification settings - Fork 26.9k
Make all non-canonical modules private? #9250
Description
This is maybe for 1.0. Recently we started marking files like model_selection._split private, so that everything has a single canonical import:
from sklearn.model_selection import cross_val_scoreFor many (older?) models that's not the case, we have
from sklearn.linear_model.logistic import LogisticRegression
from sklearn.linear_model import LogisticRegressionetc.
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.