@@ -59,7 +59,7 @@ def shapley_methods(fudge_factor: int):
5959 AntitheticSampler ,
6060 {"seed" : lambda seed : seed },
6161 ShapleyValuation ,
62- {"is_done" : (MinUpdates , {"n_updates" : fudge_factor // 2 })},
62+ {"is_done" : (MinUpdates , {"n_updates" : fudge_factor })},
6363 ),
6464 (
6565 MSRSampler ,
@@ -291,14 +291,15 @@ def test_hoeffding_bound_montecarlo(
291291@pytest .mark .parametrize (
292292 "sampler_cls, sampler_kwargs, valuation_cls, valuation_kwargs" , shapley_methods (500 )
293293)
294- def test_linear_montecarlo (
294+ def test_linear_montecarlo_with_outlier (
295295 linear_dataset ,
296296 linear_shapley ,
297297 n_jobs : int ,
298298 sampler_cls : Type ,
299299 sampler_kwargs : dict [str , Any ],
300300 valuation_cls : Type ,
301301 valuation_kwargs : dict [str , Any ],
302+ seed : int ,
302303):
303304 """Tests whether valuation methods are able to detect an obvious outlier.
304305
@@ -318,11 +319,13 @@ def test_linear_montecarlo(
318319 # train.data().y[outlier_idx] -= 100
319320
320321 if sampler_cls is not None :
321- valuation_kwargs ["sampler" ] = recursive_make (sampler_cls , sampler_kwargs )
322+ valuation_kwargs ["sampler" ] = recursive_make (
323+ sampler_cls , sampler_kwargs , seed = seed , lower_bound = 0 , upper_bound = None
324+ )
322325
323326 valuation_kwargs ["utility" ] = utility
324327 valuation_kwargs ["progress" ] = False
325- valuation = recursive_make (valuation_cls , valuation_kwargs )
328+ valuation = recursive_make (valuation_cls , valuation_kwargs , seed = seed )
326329
327330 with parallel_config (n_jobs = n_jobs ):
328331 valuation .fit (train )
0 commit comments