Skip to content

Commit 3e84184

Browse files
andreybavtBotLockermattbitHartorn
authored
[GSK-2625] Fix deprecations in tests fixtures from sklearn 1.4.0 (#1743)
* GSK-2625 * GSK-2625: fix OneHotEncoder * Regenerating pdm.lock * Revert " GSK-2625: fix OneHotEncoder" This reverts commit 0bfa24a. * Fix deprecated `sparse` argument for sklearn OneHotEncoder * Regenerating pdm.lock * Little adjustment of scores due to updated solver in sklearn * Temporarily disable drug classification fixture tests Revert this once imbalanced-learn is updated * Fix test to be selective to specific warning * Revert "Temporarily disable drug classification fixture tests" This reverts commit a33a3a8. * Regenerating pdm.lock * Regenerating pdm.lock * Remove sklearn higher bounds * Regenerating pdm.lock * Fix mlflow behaviour for windows * Fix mlflow behaviour for windows * Fast failing --------- Co-authored-by: BotLocker <bot.locker@users.noreply.github.com> Co-authored-by: Matteo Dora <matteo@giskard.ai> Co-authored-by: Hartorn <bazire@giskard.ai>
1 parent ec0f740 commit 3e84184

13 files changed

Lines changed: 948 additions & 511 deletions

.github/workflows/build-python.yml

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,29 +10,29 @@ on:
1010
workflow_dispatch:
1111
inputs:
1212
run-integration-tests:
13-
description: 'If integration test should be run'
13+
description: "If integration test should be run"
1414
required: true
1515
type: boolean
1616
default: false
1717
use-cache:
18-
description: 'If cache should be used'
18+
description: "If cache should be used"
1919
required: true
2020
type: boolean
2121
default: true
2222
is-dispatch:
23-
description: 'Just to identify manual dispatch'
23+
description: "Just to identify manual dispatch"
2424
required: true
2525
type: boolean
2626
default: true
2727
workflow_call:
2828
inputs:
2929
run-integration-tests:
30-
description: 'If integration test should be run'
30+
description: "If integration test should be run"
3131
required: true
3232
type: boolean
3333
default: false
3434
use-cache:
35-
description: 'If cache should be used'
35+
description: "If cache should be used"
3636
required: true
3737
type: boolean
3838
default: false
@@ -53,7 +53,7 @@ jobs:
5353
strategy:
5454
fail-fast: false # Do not stop when any job fails
5555
matrix:
56-
python-version: [ "3.9", "3.10", "3.11" ]
56+
python-version: ["3.9", "3.10", "3.11"]
5757
os: [ubuntu-latest]
5858
pydantic_v1: [false]
5959
pandas_v1: [false]
@@ -116,8 +116,6 @@ jobs:
116116
pdm install -G :all
117117
pdm list
118118
119-
- name: Lint code
120-
run: pdm run lint
121119
- name: Re-install lightgbm from sources for MacOS
122120
if: ${{ matrix.os == 'macos-latest' }}
123121
run: |
@@ -157,6 +155,9 @@ jobs:
157155
pdm run pip freeze | grep '^pandas'
158156
pdm run pip freeze | grep -q '^pandas==${{ matrix.pandas_v1 && '1' || '2' }}\.'
159157
158+
- name: Lint code
159+
run: pdm run lint
160+
160161
- name: Test code (concurrency)
161162
run: pdm test-worker
162163

@@ -205,7 +206,7 @@ jobs:
205206
- name: Setup PDM
206207
uses: pdm-project/setup-pdm@v3
207208
with:
208-
python-version: '3.10'
209+
python-version: "3.10"
209210
cache: false
210211
- name: Build wheel
211212
run: pdm build
@@ -233,7 +234,7 @@ jobs:
233234
- name: Setup PDM
234235
uses: pdm-project/setup-pdm@v3
235236
with:
236-
python-version: '3.10'
237+
python-version: "3.10"
237238
cache: false
238239
- name: Build wheel
239240
run: pdm build
@@ -252,8 +253,8 @@ jobs:
252253
- name: Setup PDM
253254
uses: pdm-project/setup-pdm@v3
254255
with:
255-
python-version: '3.10'
256-
version: '2.10.4' # Fix to repair the CI, use latest version when fixed on pdm
256+
python-version: "3.10"
257+
version: "2.10.4" # Fix to repair the CI, use latest version when fixed on pdm
257258
cache: false
258259
- name: Build wheel
259260
run: pdm build
@@ -291,7 +292,7 @@ jobs:
291292
- name: Set up Pandoc (needed for doc)
292293
uses: r-lib/actions/setup-pandoc@v2
293294
with:
294-
pandoc-version: '3.1.7' # https://github.com/jgm/pandoc/releases
295+
pandoc-version: "3.1.7" # https://github.com/jgm/pandoc/releases
295296

296297
- name: Install dependencies
297298
run: pdm install -G :all

docs/reference/notebooks/credit_scoring.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@
268268
"\n",
269269
"categorical_transformer = Pipeline([\n",
270270
" (\"imputer\", SimpleImputer(strategy=\"constant\", fill_value=\"missing\")),\n",
271-
" (\"onehot\", OneHotEncoder(handle_unknown=\"ignore\", sparse=False)),\n",
271+
" (\"onehot\", OneHotEncoder(handle_unknown=\"ignore\", sparse_output=False)),\n",
272272
"])\n",
273273
"\n",
274274
"preprocessor = ColumnTransformer(transformers=[\n",

docs/reference/notebooks/insurance_prediction_lgbm.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@
346346
"source": [
347347
"preprocessor = ColumnTransformer(transformers=[\n",
348348
" (\"scaler\", StandardScaler(), NUMERICAL_COLS),\n",
349-
" (\"one_hot_encoder\", OneHotEncoder(handle_unknown=\"ignore\", sparse=False), CATEGORICAL_COLS),\n",
349+
" (\"one_hot_encoder\", OneHotEncoder(handle_unknown=\"ignore\", sparse_output=False), CATEGORICAL_COLS),\n",
350350
"])"
351351
]
352352
},

docs/reference/notebooks/newspaper_classification_pytorch.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@
285285
"class TextClassificationModel(nn.Module):\n",
286286
" def __init__(self, vocab_size, embed_dim, num_class):\n",
287287
" super(TextClassificationModel, self).__init__()\n",
288-
" self.embedding = nn.EmbeddingBag(vocab_size, embed_dim, sparse=False)\n",
288+
" self.embedding = nn.EmbeddingBag(vocab_size, embed_dim, sparse_output=False)\n",
289289
" self.fc = nn.Linear(embed_dim, num_class)\n",
290290
" self.init_weights()\n",
291291
"\n",

docs/reference/notebooks/wage_classification.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@
296296
"source": [
297297
"preprocessor = ColumnTransformer(transformers=[\n",
298298
" (\"num\", StandardScaler(), NUMERICAL_FEATURES),\n",
299-
" (\"cat\", OneHotEncoder(handle_unknown=\"ignore\", sparse=False), CATEGORICAL_FEATURES),\n",
299+
" (\"cat\", OneHotEncoder(handle_unknown=\"ignore\", sparse_output=False), CATEGORICAL_FEATURES),\n",
300300
"])"
301301
]
302302
},

giskard/demo/titanic_classification.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ def get_model_and_df(model: str = ModelTypes.LOGISTIC_REGRESSION, max_iter: int
6060
cat_transormer = Pipeline(
6161
[
6262
("imputer", SimpleImputer(strategy="constant", fill_value="missing")),
63-
("onehot", OneHotEncoder(handle_unknown="ignore", sparse=False)),
63+
("onehot", OneHotEncoder(handle_unknown="ignore", sparse_output=False)),
6464
]
6565
)
6666

0 commit comments

Comments
 (0)