@@ -158,14 +158,18 @@ def test_deepnull_model_compiles(self, cls):
158158 cls = model_lib .QuantitativeDeepNull ,
159159 metric = (lambda x , y : np .corrcoef (x , y )[0 , 1 ]),
160160 target = 'cont_target' ,
161- expected = 0.98433785 ),
161+ minval = - 1 ,
162+ maxval = 1 ,
163+ ),
162164 dict (
163165 cls = model_lib .BinaryDeepNull ,
164166 metric = _accuracy ,
165167 target = 'binary_target' ,
166- expected = 0.195 ),
168+ minval = 0 ,
169+ maxval = 1 ,
170+ ),
167171 )
168- def test_deepnull_model_fit_and_predict (self , cls , metric , target , expected ):
172+ def test_deepnull_model_fit_and_predict (self , cls , metric , target , minval , maxval ):
169173 train_df , eval_df = _create_test_data ()
170174 full_config = config .get_config (config .DEEPNULL )
171175 full_config .model_config .mlp_units = (32 , 16 )
@@ -185,7 +189,7 @@ def test_deepnull_model_fit_and_predict(self, cls, metric, target, expected):
185189
186190 self .assertEqual (actual_df .shape , (200 , 2 ))
187191 self .assertEqual (list (actual_df .columns ), ['IID' , 'deepnull_prediction' ])
188- self .assertAlmostEqual (actual_metric , expected )
192+ self .assertBetween (actual_metric , minval , maxval )
189193
190194 @parameterized .parameters (
191195 dict (
0 commit comments