Skip to content

Commit f669158

Browse files
HOTFIX: remove dependence to typing_extensions
1 parent fc299ff commit f669158

File tree

3 files changed

+9
-12
lines changed

3 files changed

+9
-12
lines changed

mapie/classification.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
import warnings
44
from typing import Any, Iterable, Optional, Tuple, Union, cast
5-
from typing_extensions import Self
65

76
import numpy as np
87
from sklearn import clone
@@ -155,7 +154,7 @@ def fit(
155154
X_train: ArrayLike,
156155
y_train: ArrayLike,
157156
fit_params: Optional[dict] = None,
158-
) -> Self:
157+
) -> SplitConformalClassifier:
159158
"""
160159
Fits the base classifier to the training data.
161160
@@ -191,7 +190,7 @@ def conformalize(
191190
X_conformalize: ArrayLike,
192191
y_conformalize: ArrayLike,
193192
predict_params: Optional[dict] = None,
194-
) -> Self:
193+
) -> SplitConformalClassifier:
195194
"""
196195
Estimates the uncertainty of the base classifier by computing
197196
conformity scores on the conformalization set.
@@ -422,7 +421,7 @@ def fit_conformalize(
422421
groups: Optional[ArrayLike] = None,
423422
fit_params: Optional[dict] = None,
424423
predict_params: Optional[dict] = None,
425-
) -> Self:
424+
) -> CrossConformalClassifier:
426425
"""
427426
Estimates the uncertainty of the base classifier in a cross-validation style:
428427
fits the base classifier on different folds of the dataset

mapie/regression/quantile_regression.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
from __future__ import annotations
22

33
from typing import Iterable, List, Optional, Tuple, Union, cast, Any
4-
from typing_extensions import Self
54

65
import numpy as np
76
from sklearn.base import RegressorMixin, clone
@@ -128,7 +127,7 @@ def fit(
128127
X_train: ArrayLike,
129128
y_train: ArrayLike,
130129
fit_params: Optional[dict] = None,
131-
) -> Self:
130+
) -> ConformalizedQuantileRegressor:
132131
"""
133132
Fits three models using the regressor provided at initialisation:
134133
@@ -174,7 +173,7 @@ def conformalize(
174173
X_conformalize: ArrayLike,
175174
y_conformalize: ArrayLike,
176175
predict_params: Optional[dict] = None,
177-
) -> Self:
176+
) -> ConformalizedQuantileRegressor:
178177
"""
179178
Estimates the uncertainty of the quantile regressors by computing
180179
conformity scores on the conformalization set.

mapie/regression/regression.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
from __future__ import annotations
22

33
from typing import Any, Iterable, Optional, Tuple, Union, cast
4-
from typing_extensions import Self
54

65
import numpy as np
76
from sklearn.base import BaseEstimator, RegressorMixin, clone
@@ -151,7 +150,7 @@ def fit(
151150
X_train: ArrayLike,
152151
y_train: ArrayLike,
153152
fit_params: Optional[dict] = None,
154-
) -> Self:
153+
) -> SplitConformalRegressor:
155154
"""
156155
Fits the base regressor to the training data.
157156
@@ -187,7 +186,7 @@ def conformalize(
187186
X_conformalize: ArrayLike,
188187
y_conformalize: ArrayLike,
189188
predict_params: Optional[dict] = None,
190-
) -> Self:
189+
) -> SplitConformalRegressor:
191190
"""
192191
Estimates the uncertainty of the base regressor by computing
193192
conformity scores on the conformalization set.
@@ -438,7 +437,7 @@ def fit_conformalize(
438437
groups: Optional[ArrayLike] = None,
439438
fit_params: Optional[dict] = None,
440439
predict_params: Optional[dict] = None,
441-
) -> Self:
440+
) -> CrossConformalRegressor:
442441
"""
443442
Estimates the uncertainty of the base regressor in a cross-validation style:
444443
fits the base regressor on different folds of the dataset
@@ -751,7 +750,7 @@ def fit_conformalize(
751750
y: ArrayLike,
752751
fit_params: Optional[dict] = None,
753752
predict_params: Optional[dict] = None,
754-
) -> Self:
753+
) -> JackknifeAfterBootstrapRegressor:
755754
"""
756755
Estimates the uncertainty of the base regressor using bootstrap sampling:
757756
fits the base regressor on (potentially overlapping) samples of the dataset,

0 commit comments

Comments
 (0)