Skip to content

Commit 5a3dbf0

Browse files
committed
Enable support for scikit-learn 1.5
Signed-off-by: Keith Battocchi <[email protected]>
1 parent 4fbd10e commit 5a3dbf0

File tree

3 files changed

+13
-3
lines changed

3 files changed

+13
-3
lines changed

econml/_ensemble/_ensemble.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,14 @@
1313
import numpy as np
1414
from abc import ABCMeta, abstractmethod
1515
from sklearn.base import BaseEstimator, clone
16-
from sklearn.utils import _print_elapsed_time
1716
from sklearn.utils import check_random_state
1817
from joblib import effective_n_jobs
18+
from packaging.version import parse
19+
import sklearn
20+
if parse(sklearn.__version__) < parse("1.5"):
21+
from sklearn.utils import _print_elapsed_time
22+
else:
23+
from sklearn.utils._user_interface import _print_elapsed_time
1924

2025

2126
def _fit_single_estimator(estimator, X, y, sample_weight=None,

econml/solutions/causal_analysis/_causal_analysis.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,12 @@
3030
# TODO: this utility is documented but internal; reimplement?
3131
from sklearn.utils import _safe_indexing
3232
# TODO: this utility is even less public...
33-
from sklearn.utils import _get_column_indices
33+
from packaging.version import parse
34+
import sklearn
35+
if parse(sklearn.__version__) < parse("1.5"):
36+
from sklearn.utils import _get_column_indices
37+
else:
38+
from sklearn.utils._indexing import _get_column_indices
3439

3540

3641
class _CausalInsightsConstants:

pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ classifiers = [
2222
dependencies = [
2323
"numpy",
2424
"scipy > 1.4.0",
25-
"scikit-learn >= 1.0, < 1.5",
25+
"scikit-learn >= 1.0, < 1.6",
2626
"sparse",
2727
"joblib >= 0.13.0",
2828
"statsmodels >= 0.10",

0 commit comments

Comments
 (0)