Skip to content
Open
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
2 changes: 1 addition & 1 deletion imblearn/ensemble/_easy_ensemble.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ def _validate_y(self, y):
self._sampling_strategy = self.sampling_strategy
return y_encoded

def _validate_estimator(self, default=AdaBoostClassifier(algorithm="SAMME")):
def _validate_estimator(self, default=AdaBoostClassifier()):
"""Check the estimator and the n_estimator attribute, set the
`estimator_` attribute."""
if self.estimator is not None:
Expand Down
4 changes: 2 additions & 2 deletions imblearn/over_sampling/_smote/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
from ...metrics.pairwise import ValueDifferenceMetric
from ...utils import Substitution, check_neighbors_object, check_target_type
from ...utils._docstring import _random_state_docstring
from ...utils._sklearn_compat import _get_column_indices, _is_pandas_df, validate_data
from ...utils._sklearn_compat import _get_column_indices, is_pandas_df, validate_data
from ...utils._validation import _check_X
from ..base import BaseOverSampler

Expand Down Expand Up @@ -557,7 +557,7 @@ def _check_X_y(self, X, y):
def _validate_column_types(self, X):
"""Compute the indices of the categorical and continuous features."""
if self.categorical_features == "auto":
if not _is_pandas_df(X):
if not is_pandas_df(X):
raise ValueError(
"When `categorical_features='auto'`, the input data "
f"should be a pandas.DataFrame. Got {type(X)} instead."
Expand Down
4 changes: 2 additions & 2 deletions imblearn/utils/_sklearn_compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ def _raise_for_params(params, owner, method):
f" details. Extra parameters passed are: {set(params)}"
)

def _is_pandas_df(X):
def is_pandas_df(X):
"""Return True if the X is a pandas dataframe."""
try:
pd = sys.modules["pandas"]
Expand All @@ -255,7 +255,7 @@ def _is_pandas_df(X):
)
from sklearn.utils.validation import (
_is_fitted, # noqa: F401
_is_pandas_df, # noqa: F401
is_pandas_df, # noqa: F401
)


Expand Down
4 changes: 2 additions & 2 deletions imblearn/utils/_validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
from sklearn.utils.multiclass import type_of_target
from sklearn.utils.validation import _num_samples

from ..utils._sklearn_compat import _is_pandas_df, check_array
from ..utils._sklearn_compat import is_pandas_df, check_array

SAMPLING_KIND = (
"over-sampling",
Expand Down Expand Up @@ -639,7 +639,7 @@ def _check_X(X):
raise ValueError(
f"Found array with {n_samples} sample(s) while a minimum of 1 is required."
)
if _is_pandas_df(X):
if is_pandas_df(X):
return X
return check_array(
X, dtype=None, accept_sparse=["csr", "csc"], ensure_all_finite=False
Expand Down