From 5a076c00126cce6cb55fa3b1f1742957929421cf Mon Sep 17 00:00:00 2001 From: Olivier Grisel Date: Mon, 7 Jun 2021 17:39:12 +0200 Subject: [PATCH] FIX make check_complex_data deterministic --- sklearn/utils/estimator_checks.py | 1 + 1 file changed, 1 insertion(+) diff --git a/sklearn/utils/estimator_checks.py b/sklearn/utils/estimator_checks.py index 2058c8308ec29..cb1c96adbd153 100644 --- a/sklearn/utils/estimator_checks.py +++ b/sklearn/utils/estimator_checks.py @@ -967,6 +967,7 @@ def check_complex_data(name, estimator_orig): # Something both valid for classification and regression y = rng.randint(low=0, high=2, size=10) + 1j estimator = clone(estimator_orig) + set_random_state(estimator, random_state=0) with raises(ValueError, match="Complex data not supported"): estimator.fit(X, y)