1212 check_categorical_strings ,
1313 check_ref_quantile_cut ,
1414)
15+ from xgboost .testing .utils import predictor_equal
1516
1617sys .path .append ("tests/python" )
1718import test_quantile_dmatrix as tqd
@@ -70,7 +71,7 @@ def test_initialization(self, on_device: bool, device: str) -> None:
7071 )
7172 # query cuts from GIDX/Ellpack
7273 qXy = xgb .QuantileDMatrix (X [0 ], y [0 ], weight = w [0 ], max_bin = max_bin , ref = Xy )
73- tm . predictor_equal (Xy , qXy )
74+ predictor_equal (Xy , qXy )
7475 with pytest .raises (ValueError , match = "Inconsistent" ):
7576 # max_bin changed.
7677 xgb .QuantileDMatrix (X [0 ], y [0 ], weight = w [0 ], max_bin = max_bin - 1 , ref = Xy )
@@ -92,7 +93,7 @@ def test_initialization(self, on_device: bool, device: str) -> None:
9293 )
9394 # query cuts from GIDX/Ellpack
9495 qXy = xgb .QuantileDMatrix (X [0 ], y [0 ], weight = w [0 ], max_bin = max_bin , ref = Xy )
95- tm . predictor_equal (Xy , qXy )
96+ predictor_equal (Xy , qXy )
9697 with pytest .raises (ValueError , match = "Inconsistent" ):
9798 # max_bin changed.
9899 xgb .QuantileDMatrix (X [0 ], y [0 ], weight = w [0 ], max_bin = max_bin - 1 , ref = Xy )
@@ -247,7 +248,7 @@ def test_ltr(self) -> None:
247248 from_dm = xgb .QuantileDMatrix (X , weight = w , ref = Xy )
248249 from_qdm = xgb .QuantileDMatrix (X , weight = w , ref = Xy_qdm )
249250
250- assert tm . predictor_equal (from_qdm , from_dm )
251+ assert predictor_equal (from_qdm , from_dm )
251252
252253 @pytest .mark .skipif (** tm .no_cupy ())
253254 def test_check_inf (self ) -> None :
0 commit comments