Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TST Fixes random seed for flaky test_keras #800

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
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
11 changes: 9 additions & 2 deletions tests/model_selection/test_keras.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ def _keras_build_fn(lr=0.01):
@gen_cluster(client=True, Worker=Nanny, timeout=20)
def test_keras(c, s, a, b):
# Mirror the mnist dataset
X, y = make_classification(n_classes=10, n_features=784, n_informative=100)
X, y = make_classification(
n_classes=10, n_features=784, n_informative=100, random_state=0
)
X = X.astype("float32")
assert y.dtype == np.dtype("int64")

Expand All @@ -56,7 +58,12 @@ def test_keras(c, s, a, b):
params = {"lr": loguniform(1e-3, 1e-1)}
thomasjpfan marked this conversation as resolved.
Show resolved Hide resolved

search = IncrementalSearchCV(
model, params, max_iter=3, n_initial_parameters=5, decay_rate=None
model,
params,
max_iter=3,
n_initial_parameters=5,
decay_rate=None,
random_state=0,
)
yield search.fit(X, y)
# search.fit(X, y)
Expand Down