Skip to content

Commit 38a7e3e

Browse files
authored
chore: Compatibility with scikit-learn 1.9.0 (#1178)
1 parent 7f97dba commit 38a7e3e

11 files changed

Lines changed: 15381 additions & 15682 deletions

File tree

.circleci/config.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ version: 2.1
33
jobs:
44
python3:
55
docker:
6-
- image: cimg/python:3.9
6+
- image: cimg/python:3.13
77
environment:
88
- OMP_NUM_THREADS: 1
99
steps:
@@ -24,7 +24,7 @@ jobs:
2424

2525
deploy:
2626
docker:
27-
- image: cimg/python:3.9
27+
- image: cimg/python:3.13
2828
environment:
2929
- USERNAME: "glemaitre"
3030
- ORGANIZATION: "imbalanced-learn"

.github/workflows/circleci-artifacts-redirector.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
name: Run CircleCI artifacts redirector
1717
steps:
1818
- name: GitHub Action step
19-
uses: scientific-python/circleci-artifacts-redirector-action@v1
19+
uses: scientific-python/circleci-artifacts-redirector-action@5d358ff96e96429a5c64a969bb4a574555439f4f # v1.3.1
2020
with:
2121
repo-token: ${{ secrets.GITHUB_TOKEN }}
2222
api-token: ${{ secrets.CIRCLE_CI }}

.github/workflows/linters.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ jobs:
1414
runs-on: ubuntu-latest
1515

1616
steps:
17-
- uses: actions/checkout@v6
18-
- uses: prefix-dev/setup-pixi@v0.9.3
17+
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
18+
- uses: prefix-dev/setup-pixi@5185adfbffb4bd703da3010310260805d89ebb11 # v0.9.6
1919
with:
20-
pixi-version: v0.51.0
20+
pixi-version: v0.70.1
2121
frozen: true
2222

2323
- name: Run tests

.github/workflows/tests.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,10 @@ jobs:
3737
environment: ci-py311-latest-tensorflow
3838
runs-on: ${{ matrix.os }}
3939
steps:
40-
- uses: actions/checkout@v6
41-
- uses: prefix-dev/setup-pixi@v0.9.3
40+
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
41+
- uses: prefix-dev/setup-pixi@5185adfbffb4bd703da3010310260805d89ebb11 # v0.9.6
4242
with:
43-
pixi-version: v0.51.0
43+
pixi-version: v0.70.1
4444
environments: ${{ matrix.environment }}
4545
# we can freeze the environment and manually bump the dependencies to the
4646
# latest version time to time.
@@ -50,7 +50,7 @@ jobs:
5050
run: pixi run -e ${{ matrix.environment }} tests -n 3
5151

5252
- name: Upload coverage reports to Codecov
53-
uses: codecov/codecov-action@v5.5.2
53+
uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0
5454
with:
5555
token: ${{ secrets.CODECOV_TOKEN }}
5656
slug: scikit-learn-contrib/imbalanced-learn

build_tools/circle/build_doc.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@ if [[ `type -t deactivate` ]]; then
88
fi
99

1010
# Install pixi
11-
curl -fsSL https://pixi.sh/install.sh | bash
11+
# Keep this version in sync with `pixi-version` in `.github/workflows/*.yml`.
12+
PIXI_VERSION="v0.70.1"
13+
curl -fsSL https://pixi.sh/install.sh | PIXI_VERSION="${PIXI_VERSION}" bash
1214
export PATH=/home/circleci/.pixi/bin:$PATH
1315

1416
# The pipefail is requested to propagate exit code

imblearn/metrics/_classification.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ def sensitivity_specificity_support(
165165
if average not in average_options and average != "binary":
166166
raise ValueError("average has to be one of " + str(average_options))
167167

168-
y_type, y_true, y_pred, sample_weight = _check_targets(
168+
y_type, _, y_true, y_pred, sample_weight = _check_targets(
169169
y_true, y_pred, sample_weight=sample_weight
170170
)
171171
present_labels = unique_labels(y_true, y_pred)
@@ -1121,7 +1121,7 @@ def macro_averaged_mean_absolute_error(y_true, y_pred, *, sample_weight=None):
11211121
>>> macro_averaged_mean_absolute_error(y_true_imbalanced, y_pred)
11221122
0.16...
11231123
"""
1124-
_, y_true, y_pred, sample_weight = _check_targets(y_true, y_pred, sample_weight)
1124+
_, _, y_true, y_pred, sample_weight = _check_targets(y_true, y_pred, sample_weight)
11251125
if sample_weight is not None:
11261126
sample_weight = column_or_1d(sample_weight)
11271127
else:

imblearn/metrics/tests/test_pairwise.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import pytest
88
from sklearn.exceptions import NotFittedError
99
from sklearn.preprocessing import LabelEncoder, OrdinalEncoder
10-
from sklearn.utils._testing import _convert_container
10+
from sklearn_compat.utils._testing import _convert_container
1111

1212
from imblearn.metrics.pairwise import ValueDifferenceMetric
1313

imblearn/over_sampling/_smote/tests/test_smoten.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import pytest
33
from sklearn.exceptions import DataConversionWarning
44
from sklearn.preprocessing import OneHotEncoder, OrdinalEncoder
5-
from sklearn.utils._testing import _convert_container
5+
from sklearn_compat.utils._testing import _convert_container
66

77
from imblearn.over_sampling import SMOTEN
88

imblearn/over_sampling/tests/test_random_over_sampler.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@
1010
import pytest
1111
from sklearn.datasets import make_classification
1212
from sklearn.utils._testing import (
13-
_convert_container,
1413
assert_allclose,
1514
assert_array_equal,
1615
)
16+
from sklearn_compat.utils._testing import _convert_container
1717

1818
from imblearn.over_sampling import RandomOverSampler
1919

0 commit comments

Comments
 (0)