Skip to content

Commit

Permalink
mypy
Browse files Browse the repository at this point in the history
  • Loading branch information
auguste-probabl committed Feb 28, 2025
1 parent a8dc4a2 commit 3ca3f74
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -120,11 +120,11 @@ def _feature_permutation(
data_source_hash: Optional[int] = None,
X: Optional[ArrayLike] = None,
y: Optional[ArrayLike] = None,
scoring: Union[str, list[str]] = None, # Typing TODO
scoring: Union[str, list[str], None] = None, # Typing TODO
**kwargs,
) -> pd.DataFrame:
if data_source_hash is None:
X, y_true, data_source_hash = self._get_X_y_and_data_source_hash(
X_, y_true, data_source_hash = self._get_X_y_and_data_source_hash(
data_source=data_source, X=X, y=y
)

Expand Down Expand Up @@ -153,7 +153,7 @@ def _feature_permutation(
else:
sklearn_score = permutation_importance(
estimator=self._parent.estimator_,
X=X,
X=X_,
y=y_true,
scoring=scoring,
**kwargs,
Expand All @@ -163,7 +163,7 @@ def _feature_permutation(
feature_names = (
self._parent.estimator_.feature_names_in_
if hasattr(self._parent.estimator_, "feature_names_in_")
else [f"Feature #{i}" for i in range(X.shape[1])]
else [f"Feature #{i}" for i in range(X_.shape[1])]
)

# If there is more than one metric
Expand Down

0 comments on commit 3ca3f74

Please sign in to comment.