Skip to content

MAINT cleanup utils.__init__: move indexing tools into dedicated submodule #28546

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

Merged
merged 7 commits into from
Mar 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion sklearn/compose/_column_transformer.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@
from ..base import TransformerMixin, _fit_context, clone
from ..pipeline import _fit_transform_one, _name_estimators, _transform_one
from ..preprocessing import FunctionTransformer
from ..utils import Bunch, _get_column_indices, _safe_indexing
from ..utils import Bunch, _safe_indexing
from ..utils._estimator_html_repr import _VisualBlock
from ..utils._indexing import _get_column_indices
from ..utils._metadata_requests import METHODS
from ..utils._param_validation import HasMethods, Hidden, Interval, StrOptions
from ..utils._set_output import (
Expand Down
9 changes: 2 additions & 7 deletions sklearn/feature_selection/_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,10 @@
from scipy.sparse import csc_matrix, issparse

from ..base import TransformerMixin
from ..utils import (
_is_pandas_df,
_safe_indexing,
check_array,
safe_sqr,
)
from ..utils import _safe_indexing, check_array, safe_sqr
from ..utils._set_output import _get_output_config
from ..utils._tags import _safe_tags
from ..utils.validation import _check_feature_names_in, check_is_fitted
from ..utils.validation import _check_feature_names_in, _is_pandas_df, check_is_fitted


class SelectorMixin(TransformerMixin, metaclass=ABCMeta):
Expand Down
8 changes: 2 additions & 6 deletions sklearn/impute/_iterative.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,8 @@
from ..base import _fit_context, clone
from ..exceptions import ConvergenceWarning
from ..preprocessing import normalize
from ..utils import (
_safe_assign,
_safe_indexing,
check_array,
check_random_state,
)
from ..utils import _safe_indexing, check_array, check_random_state
from ..utils._indexing import _safe_assign
from ..utils._mask import _get_mask
from ..utils._missing import is_scalar_nan
from ..utils._param_validation import HasMethods, Interval, StrOptions
Expand Down
10 changes: 2 additions & 8 deletions sklearn/inspection/_partial_dependence.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,8 @@
)
from ..exceptions import NotFittedError
from ..tree import DecisionTreeRegressor
from ..utils import (
Bunch,
_determine_key_type,
_get_column_indices,
_safe_assign,
_safe_indexing,
check_array,
)
from ..utils import Bunch, _safe_indexing, check_array
from ..utils._indexing import _determine_key_type, _get_column_indices, _safe_assign
from ..utils._optional_dependencies import check_matplotlib_support # noqa
from ..utils._param_validation import (
HasMethods,
Expand Down
Loading