Skip to content

Commit

Permalink
add failing test
Browse files Browse the repository at this point in the history
  • Loading branch information
auguste-probabl committed Mar 4, 2025
1 parent 66ef1ba commit 42bfb66
Showing 1 changed file with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,22 @@ def test_cache_random_state(regression_data):
pd.testing.assert_frame_equal(cached_result, result)


def test_cache_scoring(regression_data):
"""`scoring` is in the cache."""

X, y = regression_data
report = EstimatorReport(LinearRegression(), X_train=X, y_train=y)

report.feature_importance.feature_permutation(
data_source="train", scoring="r2", random_state=42
)
report.feature_importance.feature_permutation(
data_source="train", scoring="neg_root_mean_squared_error", random_state=42
)
# Scorings are different, so cache keys should be different
assert len(report._cache) == 2


@pytest.mark.parametrize(
"scoring",
[
Expand Down

0 comments on commit 42bfb66

Please sign in to comment.