Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion tests/gcm/test_auto.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@ def _generate_non_linear_regression_data():


def _generate_linear_classification_data():
X = np.random.normal(0, 1, (100, 5))
# 500 samples instead of 100 to give cross-validation a stable enough signal
# so that LogisticRegression reliably wins over SVC for linear data.
X = np.random.normal(0, 1, (500, 5))
Y = (np.sum(X * np.random.uniform(-5, 5, X.shape[1]), axis=1) > 0).astype(str)
Comment on lines +46 to 47
Copy link

Copilot AI Apr 19, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test data generator still relies on the global NumPy RNG state, so outcomes can remain non-deterministic (and potentially influenced by other tests consuming randomness). To fully eliminate flakiness, consider using a local, fixed-seed generator (e.g., rng = np.random.default_rng(seed) and calling rng.normal(...), rng.uniform(...)) inside _generate_linear_classification_data() so the dataset is reproducible across runs.

Suggested change
X = np.random.normal(0, 1, (500, 5))
Y = (np.sum(X * np.random.uniform(-5, 5, X.shape[1]), axis=1) > 0).astype(str)
rng = np.random.default_rng(0)
X = rng.normal(0, 1, (500, 5))
Y = (np.sum(X * rng.uniform(-5, 5, X.shape[1]), axis=1) > 0).astype(str)

Copilot uses AI. Check for mistakes.

return X, Y
Expand Down
Loading