Skip to content

Commit

Permalink
update CI to test againt latest everything (#707)
Browse files Browse the repository at this point in the history
* update CI to test againt latest everything

Signed-off-by: xadupre <[email protected]>

* version

Signed-off-by: xadupre <[email protected]>

* fix diff

Signed-off-by: xadupre <[email protected]>

---------

Signed-off-by: xadupre <[email protected]>
  • Loading branch information
xadupre authored Dec 23, 2024
1 parent 4133713 commit 2834b4d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 24 deletions.
15 changes: 3 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: CI
on: [push, pull_request]
jobs:
run:
name: ${{ matrix.os }} py==${{ matrix.python_version }} - sklearn${{ matrix.sklearn_version }} - ${{ matrix.onnxrt_version }}
name: ${{ matrix.os }} py==${{ matrix.python_version }} - sklearn${{ matrix.sklearn_version }} - ${{ matrix.onnxrt_version }} - xgboost${{ matrix.xgboost_version }} - lightgbm${{ matrix.lgbm_version }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
Expand All @@ -18,15 +18,6 @@ jobs:
sklearn_version: '==1.6.0'
lgbm_version: ">=4"
xgboost_version: ">=2"
- python_version: '3.12'
documentation: 0
numpy_version: '>=1.21.1'
scipy_version: '>=1.7.0'
onnx_version: 'onnx==1.16.0'
onnxrt_version: 'onnxruntime==1.18.0'
sklearn_version: '==1.4.2'
lgbm_version: ">=4"
xgboost_version: ">=2"
- python_version: '3.11'
documentation: 0
numpy_version: '>=1.21.1'
Expand Down Expand Up @@ -96,14 +87,14 @@ jobs:
python -c "from sklearn import __version__;print('sklearn', __version__)"
python -c "from onnxruntime import __version__;print('onnxruntime', __version__)"
python -c "from onnx import __version__;print('onnx', __version__)"
python -c "from catboost import __version__;print('catboost', __version__)"
python -c "import onnx.defs;print('onnx_opset_version', onnx.defs.onnx_opset_version())"
- name: versions lightgbm
- name: versions lightgbm, xgboost, catboost
if: matrix.os != 'macos-latest'
run: |
python -c "from lightgbm import __version__;print('lightgbm', __version__)"
python -c "from xgboost import __version__;print('xgboost', __version__)"
python -c "from catboost import __version__;print('catboost', __version__)"
- name: Run tests baseline
run: pytest --maxfail=10 --durations=10 tests/baseline
Expand Down
20 changes: 8 additions & 12 deletions tests/xgboost/test_xgboost_converters_base_score.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,8 @@ def test_xgbregressor_sparse_base_score(self):
rf = XGBRegressor(n_estimators=3, max_depth=4, random_state=0, base_score=0.5)
rf.fit(X_sp, y)
expected = rf.predict(X).astype(np.float32).reshape((-1, 1))
expected_sparse = rf.predict(X_sp).astype(np.float32).reshape((-1, 1))
diff = np.abs(expected - expected_sparse)
self.assertNotEqual(diff.min(), diff.max())
# expected sparse is expected ot be diffrent than expected,
# expected_sparse = rf.predict(X_sp).astype(np.float32).reshape((-1, 1))

onx = convert_xgboost(
rf,
Expand All @@ -64,9 +63,8 @@ def test_xgbregressor_sparse_no_base_score(self):
rf = XGBRegressor(n_estimators=3, max_depth=4, random_state=0)
rf.fit(X_sp, y)
expected = rf.predict(X).astype(np.float32).reshape((-1, 1))
expected_sparse = rf.predict(X_sp).astype(np.float32).reshape((-1, 1))
diff = np.abs(expected - expected_sparse)
self.assertNotEqual(diff.min(), diff.max())
# expected sparse is expected ot be diffrent than expected,
# expected_sparse = rf.predict(X_sp).astype(np.float32).reshape((-1, 1))

onx = convert_xgboost(
rf,
Expand Down Expand Up @@ -94,9 +92,8 @@ def test_xgbclassifier_sparse_base_score(self):
rf = XGBClassifier(n_estimators=3, max_depth=4, random_state=0, base_score=0.5)
rf.fit(X_sp, y)
expected = rf.predict_proba(X).astype(np.float32).reshape((-1, 1))
expected_sparse = rf.predict_proba(X_sp).astype(np.float32).reshape((-1, 1))
diff = np.abs(expected - expected_sparse)
self.assertNotEqual(diff.min(), diff.max())
# expected sparse is expected ot be diffrent than expected,
# expected_sparse = rf.predict_proba(X_sp).astype(np.float32).reshape((-1, 1))

onx = convert_xgboost(
rf,
Expand Down Expand Up @@ -124,9 +121,8 @@ def test_xgbclassifier_sparse_no_base_score(self):
rf = XGBClassifier(n_estimators=3, max_depth=4, random_state=0)
rf.fit(X_sp, y)
expected = rf.predict_proba(X).astype(np.float32).reshape((-1, 1))
expected_sparse = rf.predict_proba(X_sp).astype(np.float32).reshape((-1, 1))
diff = np.abs(expected - expected_sparse)
self.assertNotEqual(diff.min(), diff.max())
# expected sparse is expected ot be diffrent than expected,
# expected_sparse = rf.predict_proba(X_sp).astype(np.float32).reshape((-1, 1))

onx = convert_xgboost(
rf,
Expand Down

0 comments on commit 2834b4d

Please sign in to comment.