From 2834b4d66dd617c6872d015c08291474e2097ba0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Xavier=20Dupr=C3=A9?= Date: Mon, 23 Dec 2024 14:34:22 +0100 Subject: [PATCH] update CI to test againt latest everything (#707) * update CI to test againt latest everything Signed-off-by: xadupre * version Signed-off-by: xadupre * fix diff Signed-off-by: xadupre --------- Signed-off-by: xadupre --- .github/workflows/ci.yml | 15 +++----------- .../test_xgboost_converters_base_score.py | 20 ++++++++----------- 2 files changed, 11 insertions(+), 24 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8e3f3826..56a0f2d4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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: @@ -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' @@ -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 diff --git a/tests/xgboost/test_xgboost_converters_base_score.py b/tests/xgboost/test_xgboost_converters_base_score.py index e719aa01..7ce1697a 100644 --- a/tests/xgboost/test_xgboost_converters_base_score.py +++ b/tests/xgboost/test_xgboost_converters_base_score.py @@ -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, @@ -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, @@ -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, @@ -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,