File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -1193,7 +1193,7 @@ def check_estimators_pickle(name, estimator_orig):
11931193 if name in ALLOW_NAN :
11941194 # set random 10 elements to be np.nan
11951195 rng = np .random .RandomState (42 )
1196- mask = rng .choice (X .size , 10 , replace = True )
1196+ mask = rng .choice (X .size , 10 , replace = False )
11971197 X .reshape (- 1 )[mask ] = np .nan
11981198 estimator .fit (X , y )
11991199
@@ -1209,12 +1209,11 @@ def check_estimators_pickle(name, estimator_orig):
12091209 for method in nan_result :
12101210 unpickled_nan_result = getattr (unpickled_estimator , method )(X )
12111211 if name == 'ChainedImputer' :
1212- assert_allclose_dense_sparse (nan_result [method ],
1213- unpickled_nan_result ,
1214- rtol = 1e-5 , atol = 0.1 )
1212+ tol = {'rtol' : 1e-5 , 'atol' : 0.1 }
12151213 else :
1214+ tol = {}
12161215 assert_allclose_dense_sparse (nan_result [method ],
1217- unpickled_nan_result )
1216+ unpickled_nan_result , ** tol )
12181217
12191218
12201219@ignore_warnings (category = (DeprecationWarning , FutureWarning ))
You can’t perform that action at this time.
0 commit comments