Skip to content

Commit

Permalink
Merge branch 'main' into prophet-docs
Browse files Browse the repository at this point in the history
  • Loading branch information
ParthivNaresh committed Sep 7, 2021
2 parents 864df30 + 4abb537 commit 95674e6
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/source/release_notes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ Release Notes
**Future Releases**
* Enhancements
* Added label encoder to ``XGBoostClassifier`` to remove the warning :pr:`2701`
* Set ``eval_metric`` to ``logloss`` for ``XGBoostClassifier`` :pr:`2741`
* Added support for ``woodwork`` versions ``0.7.0`` and ``0.7.1`` :pr:`2743`
* Fixes
* Changes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ def __init__(
min_child_weight=1,
n_estimators=100,
random_seed=0,
eval_metric="logloss",
n_jobs=-1,
**kwargs,
):
Expand All @@ -76,6 +77,7 @@ def __init__(
"min_child_weight": min_child_weight,
"n_estimators": n_estimators,
"n_jobs": n_jobs,
"eval_metric": eval_metric,
}
parameters.update(kwargs)
if "use_label_encoder" in parameters:
Expand Down
1 change: 1 addition & 0 deletions evalml/tests/component_tests/test_components.py
Original file line number Diff line number Diff line change
Expand Up @@ -415,6 +415,7 @@ def test_describe_component():
"min_child_weight": 1,
"n_estimators": 75,
"n_jobs": -1,
"eval_metric": "logloss",
},
}
assert xgb_regressor.describe(return_dict=True) == {
Expand Down
11 changes: 11 additions & 0 deletions evalml/tests/component_tests/test_xgboost_classifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,17 @@
xgb = importorskip("xgboost", reason="Skipping test because xgboost not installed")


@pytest.mark.parametrize("metric", ["error", "logloss"])
def test_xgboost_classifier_default_evaluation_metric(metric):
xgb = XGBoostClassifier(eval_metric=metric)
assert xgb.parameters["eval_metric"] == metric
assert xgb._component_obj.get_params()["eval_metric"] == metric

xgb = XGBoostClassifier()
assert xgb.parameters["eval_metric"] == "logloss"
assert xgb._component_obj.get_params()["eval_metric"] == "logloss"


def test_xgboost_classifier_random_seed_bounds_seed(X_y_binary):
"""ensure xgboost's RNG doesn't fail for the min/max bounds we support on user-inputted random seeds"""
X, y = X_y_binary
Expand Down

0 comments on commit 95674e6

Please sign in to comment.