Skip to content

Commit fd3cb32

Browse files
author
Thierry RAMORASOAVINA
committed
Adapt to scikit-learn 1.8.0
- Since version 1.7.2 the new parameters or functions are already available so no deprecated calls should remain - For python 3.10, 1.7.2 is still used - For python 3.11+, the later 1.8.0+ versions are used
1 parent b81ec6e commit fd3cb32

File tree

5 files changed

+6
-8
lines changed

5 files changed

+6
-8
lines changed

doc/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@ nbconvert==6.4.4
55
nbformat==5.3.0
66
numpydoc>=1.5.0
77
pandas>=0.25.3,<=2.3.3
8-
scikit-learn>=0.22.2,<=1.7.2
8+
scikit-learn>=1.7.2,<1.9.0
99
sphinx-copybutton>=0.5.0

khiops/sklearn/dataset.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1077,7 +1077,7 @@ def __init__(self, name, array, key=None):
10771077
raise TypeError(type_error_message("array", array, np.ndarray, Sequence))
10781078

10791079
# Initialize the members
1080-
self.data_source = check_array(array, ensure_2d=True, force_all_finite=False)
1080+
self.data_source = check_array(array, ensure_2d=True, ensure_all_finite=False)
10811081
self.column_ids = column_or_1d(range(self.data_source.shape[1]))
10821082
self.khiops_types = {
10831083
column_id: get_khiops_type(self.data_source.dtype)

packaging/conda/meta.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ requirements:
2525
- python
2626
- khiops-core =11.0.0
2727
- pandas >=0.25.3,<=2.3.3
28-
- scikit-learn >=0.22.2
28+
- scikit-learn>=1.7.2,<1.9.0
2929
run_constrained:
3030
# do not necessary use the latest version
3131
# to avoid undesired breaking changes

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ requires-python = ">=3.8"
106106
dependencies = [
107107
# do not use the latest versions, to avoid undesired breaking changes
108108
"pandas>=0.25.3,<=2.3.3",
109-
"scikit-learn>=0.22.2,<=1.7.2",
109+
"scikit-learn>=1.7.2,<1.9.0",
110110
]
111111

112112
[project.urls]

tests/test_sklearn.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
import numpy as np
1919
import pandas as pd
2020
from sklearn.exceptions import NotFittedError
21-
from sklearn.utils.estimator_checks import check_estimator
21+
from sklearn.utils.estimator_checks import estimator_checks_generator
2222
from sklearn.utils.validation import check_is_fitted
2323

2424
import khiops.core as kh
@@ -1784,9 +1784,7 @@ def test_sklearn_check_estimator(self):
17841784
# Execute sklearn's estimator test battery
17851785
print("")
17861786
for khiops_estimator in khiops_estimators:
1787-
for estimator, check in check_estimator(
1788-
khiops_estimator, generate_only=True
1789-
):
1787+
for estimator, check in estimator_checks_generator(khiops_estimator):
17901788
check_name = check.func.__name__
17911789
if check_name == "check_n_features_in_after_fitting":
17921790
continue

0 commit comments

Comments
 (0)