Skip to content

Commit

Permalink
Upgrade evalml to latest xgboost (#3805)
Browse files Browse the repository at this point in the history
* Remove all references to xgboost label encoder

* Update release notes

* Cap featuretools below 1.17.0

* Fix dependencies

* Update meta.yaml

* Update core-requirements.txt

* Update setup.cfg

* Update latest_dependency_versions.txt

Co-authored-by: chukarsten <64713315+chukarsten@users.noreply.github.com>
  • Loading branch information
eccabay and chukarsten committed Nov 2, 2022
1 parent 5945a41 commit a9c02aa
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 43 deletions.
4 changes: 2 additions & 2 deletions .github/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ outputs:
- requirements-parser >=0.2.0
- shap >=0.40.0
- texttable >=1.6.2
- woodwork >=0.19.0
- featuretools>=1.7.0
- woodwork >=0.19.0,<0.20.0
- featuretools>=1.7.0,<1.17.0
- nlp-primitives>=2.2.0,!=2.6.0
- python >=3.8.*
- networkx >=2.5,<2.6
Expand Down
4 changes: 2 additions & 2 deletions core-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ requirements-parser>=0.2.0
shap>=0.40.0
statsmodels>=0.12.2
texttable>=1.6.2
woodwork>=0.19.0
woodwork>=0.19.0,<0.20.0
dask>=2021.10.0, !=2022.10.1
nlp-primitives>=2.2.0,!=2.6.0
featuretools>=1.7.0
featuretools>=1.7.0,<1.17.0
networkx>=2.5,<2.6
2 changes: 2 additions & 0 deletions docs/source/release_notes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ Release Notes
* Changes
* Capped dask at < 2022.10.1 :pr:`3797`
* Uncapped dask and excluded 2022.10.1 from viable versions :pr:`3803`
* Removed all references to XGBoost's deprecated ``_use_label_encoder`` argument :pr:`3805`
* Capped featuretools at < 1.17.0 :pr:`3805`
* Documentation Changes
* Testing Changes

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,15 +76,11 @@ def __init__(
"eval_metric": eval_metric,
}
parameters.update(kwargs)
if "use_label_encoder" in parameters:
parameters.pop("use_label_encoder")
xgb_error_msg = (
"XGBoost is not installed. Please install using `pip install xgboost.`"
)
xgb = import_or_raise("xgboost", error_msg=xgb_error_msg)
xgb_classifier = xgb.XGBClassifier(
use_label_encoder=False, random_state=random_seed, **parameters
)
xgb_classifier = xgb.XGBClassifier(random_state=random_seed, **parameters)
self._label_encoder = None
super().__init__(
parameters=parameters,
Expand Down
28 changes: 0 additions & 28 deletions evalml/tests/component_tests/test_xgboost_classifier.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import string
import warnings
from unittest.mock import patch

import numpy as np
Expand Down Expand Up @@ -99,33 +98,6 @@ def test_xgboost_predict_all_boolean_columns():
assert not preds.isna().any()


@pytest.mark.xfail
@pytest.mark.parametrize(
"y,label_encoder",
[
([True, False, False], True),
([1.0, 1.1, 1.1], True),
(["One", "Two", "Two"], True),
([0, 1, 1], False),
],
)
def test_xgboost_catch_warnings_label_encoder(y, label_encoder):
X = pd.DataFrame({"a": [True, False, True], "b": [True, False, True]})
y = pd.Series(y)
xgb = XGBoostClassifier()
with warnings.catch_warnings(record=True) as w:
warnings.simplefilter("always")
xgb.fit(X, y)
assert len(w) == 0
preds = xgb.predict(X)
# make sure the predicted outputs are the same labels as the passed-in labels
assert preds[0] in y.values
if label_encoder:
assert xgb._label_encoder is not None
return
assert xgb._label_encoder is None


@patch("xgboost.XGBClassifier.fit")
@patch("xgboost.XGBClassifier.predict")
@patch("xgboost.XGBClassifier.predict_proba")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
catboost==1.1
catboost==1.1.1
click==8.1.3
cloudpickle==2.2.0
colorama==0.4.6
dask==2022.10.2
featuretools==1.17.0
featuretools==1.16.0
graphviz==0.20.1
imbalanced-learn==0.9.1
ipywidgets==8.0.2
Expand All @@ -26,8 +26,8 @@ scipy==1.8.1
seaborn==0.12.1
shap==0.41.0
sktime==0.13.0
statsmodels==0.13.2
statsmodels==0.13.4
texttable==1.6.4
vowpalwabbit==9.5.0
woodwork==0.19.0
xgboost==1.6.2
xgboost==1.7.0
4 changes: 2 additions & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,10 @@ install_requires =
shap >= 0.40.0
statsmodels >= 0.12.2
texttable >= 1.6.2
woodwork >= 0.19.0
woodwork >= 0.19.0, < 0.20.0
dask >= 2021.10.0, !=2022.10.1
nlp-primitives >= 2.2.0,!=2.6.0
featuretools >= 1.7.0
featuretools >= 1.7.0, < 1.17.0
networkx >= 2.5, < 2.6
plotly >= 5.0.0
kaleido >= 0.1.0
Expand Down

0 comments on commit a9c02aa

Please sign in to comment.