8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 46a5aa5 commit 6e9d254Copy full SHA for 6e9d254
sklearn/tests/test_isotonic.py
@@ -313,13 +313,17 @@ def test_isotonic_zero_weight_loop():
313
# Test from @ogrisel's issue:
314
# https://github.com/scikit-learn/scikit-learn/issues/4297
315
316
+ # Get deterministic RNG with seed
317
+ rng = np.random.RandomState(42)
318
+
319
+ # Create regression and samples
320
regression = IsotonicRegression()
321
n_samples = 50
322
x = np.linspace(-3, 3, n_samples)
- y = x + np.random.uniform(size=n_samples)
323
+ y = x + rng.uniform(size=n_samples)
324
325
# Get some random weights and zero out
- w = np.random.uniform(size=n_samples)
326
+ w = rng.uniform(size=n_samples)
327
w[5:8] = 0
328
regression.fit(x, y, sample_weight=w)
329
0 commit comments