From 5fda6b174178e1e5ef3a7c40b48f1aaf3c56899a Mon Sep 17 00:00:00 2001 From: Dylan Sherry Date: Fri, 10 Apr 2020 20:55:31 -0400 Subject: [PATCH] Fix random seed for xgboost --- evalml/tests/pipeline_tests/test_xgboost.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/evalml/tests/pipeline_tests/test_xgboost.py b/evalml/tests/pipeline_tests/test_xgboost.py index 27290b5382..55b10f7205 100644 --- a/evalml/tests/pipeline_tests/test_xgboost.py +++ b/evalml/tests/pipeline_tests/test_xgboost.py @@ -111,7 +111,7 @@ def test_xg_multi(X_y_multi): } } - clf = XGBoostPipeline(objective=objective, parameters=parameters) + clf = XGBoostPipeline(objective=objective, parameters=parameters, random_state=get_random_state(random_seed)) clf.fit(X, y) y_pred = clf.predict(X) clf_score = accuracy_score(y, y_pred) @@ -148,7 +148,7 @@ def test_xg_input_feature_names(X_y): } } - clf = XGBoostPipeline(objective=objective, parameters=parameters) + clf = XGBoostPipeline(objective=objective, parameters=parameters, random_state=42) clf.fit(X, y) assert len(clf.feature_importances) == len(X.columns) assert not clf.feature_importances.isnull().all().all()