Skip to content

Commit

Permalink
fixing random seeds
Browse files Browse the repository at this point in the history
  • Loading branch information
CDonnerer committed Jan 2, 2023
1 parent e1aff28 commit c086297
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ def small_X_y_count_data():
"""Small set of X, y data, with y being counts (positive int)"""

def generate_count_data(n_samples=100):
np.random.seed(11) # 'tuned' to be simple to test against
X = np.random.uniform(-2, 0, n_samples)
n = 66 * np.abs(np.cos(X))
p = 0.5 * np.abs(np.cos(X / 3))
Expand Down
4 changes: 2 additions & 2 deletions tests/test_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def test_XGBDistribution_early_stopping_fit(small_train_test_data):
def test_XGBDistribution_early_stopping_fit_single_param_distribution(
small_train_test_count_data,
):
"""Integration test for single param dist"""
"""Integration test for single param dist (which operate on squeezed arrays)"""

X_train, X_test, y_train, y_test = small_train_test_count_data

Expand All @@ -42,7 +42,7 @@ def test_XGBDistribution_early_stopping_fit_single_param_distribution(
model.fit(X_train, y_train, eval_set=[(X_test, y_test)])
evals_result = model.evals_result()

# assert model.best_iteration == 6
assert model.best_iteration == 10
assert isinstance(evals_result, dict)


Expand Down

0 comments on commit c086297

Please sign in to comment.