Skip to content

Commit

Permalink
Fix random seed for xgboost
Browse files Browse the repository at this point in the history
  • Loading branch information
dsherry committed Apr 11, 2020
1 parent 8fb26d5 commit 5fda6b1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions evalml/tests/pipeline_tests/test_xgboost.py
Expand Up @@ -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)
Expand Down Expand Up @@ -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()
Expand Down

0 comments on commit 5fda6b1

Please sign in to comment.