Skip to content

Commit 8d560e6

Browse files
committed
Delete unnecessary dependency on external dataset for tests
1 parent 5962321 commit 8d560e6

File tree

3 files changed

+3
-17
lines changed

3 files changed

+3
-17
lines changed

.test_durations

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1781,10 +1781,6 @@
17811781
"tests/value/shapley/test_montecarlo.py::test_linear_montecarlo_with_outlier[owen-kwargs1-scorer0-0.2-2-0-21]": 6.573138832000012,
17821782
"tests/value/shapley/test_montecarlo.py::test_linear_montecarlo_with_outlier[owen_antithetic-kwargs2-scorer0-0.2-2-0-21]": 10.124256999999972,
17831783
"tests/value/shapley/test_montecarlo.py::test_linear_montecarlo_with_outlier[permutation_montecarlo-kwargs0-scorer0-0.2-2-0-21]": 2.7115268339999545,
1784-
"tests/value/shapley/test_montecarlo.py::test_montecarlo_shapley_housing_dataset[12-3-12-combinatorial_montecarlo-kwargs0]": 0.16786966001382098,
1785-
"tests/value/shapley/test_montecarlo.py::test_montecarlo_shapley_housing_dataset[12-3-12-owen-kwargs1]": 17.011920137971174,
1786-
"tests/value/shapley/test_montecarlo.py::test_montecarlo_shapley_housing_dataset[12-3-12-owen_antithetic-kwargs2]": 35.88025256394758,
1787-
"tests/value/shapley/test_montecarlo.py::test_montecarlo_shapley_housing_dataset[12-3-4-group_testing-kwargs3]": 0.25901710899779573,
17881784
"tests/value/shapley/test_montecarlo.py::test_seed[combinatorial_montecarlo-kwargs0-test_game0]": 0.04085670800000685,
17891785
"tests/value/shapley/test_montecarlo.py::test_seed[group_testing-kwargs3-test_game0]": 0.23488145900003587,
17901786
"tests/value/shapley/test_montecarlo.py::test_seed[owen-kwargs1-test_game0]": 0.30296191700003305,

tests/conftest.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -129,15 +129,6 @@ def memcached_client(
129129
) from e
130130

131131

132-
@pytest.fixture(scope="function")
133-
def housing_dataset(num_points, num_features) -> Dataset:
134-
dataset = datasets.fetch_california_housing()
135-
dataset.data = dataset.data[:num_points, :num_features]
136-
dataset.feature_names = dataset.feature_names[:num_features]
137-
dataset.target = dataset.target[:num_points]
138-
return Dataset.from_sklearn(dataset, train_size=0.5)
139-
140-
141132
@pytest.fixture(scope="function")
142133
def linear_dataset(a: float, b: float, num_points: int):
143134
"""Constructs a dataset sampling from y=ax+b + eps, with eps~Gaussian and

tests/utils/test_utility.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,12 @@
66
import pytest
77
from sklearn.linear_model import LinearRegression
88

9-
from pydvl.utils import DataUtilityLearning, Scorer, Utility, powerset
9+
from pydvl.utils import Dataset, DataUtilityLearning, Scorer, Utility, powerset
1010
from pydvl.utils.caching import CachedFuncConfig, InMemoryCacheBackend
1111

1212

1313
@pytest.mark.parametrize("show_warnings", [False, True])
14-
@pytest.mark.parametrize("num_points, num_features", [(4, 4)])
15-
def test_utility_show_warnings(housing_dataset, show_warnings, recwarn):
14+
def test_utility_show_warnings(show_warnings, recwarn):
1615
class WarningModel:
1716
def fit(self, x, y):
1817
warnings.warn("Warning model fit")
@@ -28,7 +27,7 @@ def score(self, x, y):
2827

2928
utility = Utility(
3029
model=WarningModel(),
31-
data=housing_dataset,
30+
data=Dataset.from_arrays(np.zeros((4, 4)), np.zeros(4)),
3231
show_warnings=show_warnings,
3332
)
3433
utility([0])

0 commit comments

Comments
 (0)