Skip to content

Commit 6c4f1c5

Browse files
correct single_estimator_
1 parent a84fab1 commit 6c4f1c5

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

mapie/estimator/regressor.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -529,9 +529,10 @@ def fit_single_estimator(
529529
) -> RegressorMixin:
530530

531531
self.use_split_method_ = check_no_agg_cv(X, self.cv, self.no_agg_cv_)
532+
single_estimator_: RegressorMixin
532533

533534
if self.cv == "prefit":
534-
self.single_estimator_ = self.estimator
535+
single_estimator_ = self.estimator
535536
else:
536537
cv = cast(BaseCrossValidator, self.cv)
537538
train_indexes = [index for index, _ in cv.split(X, y, groups)][0]
@@ -541,7 +542,7 @@ def fit_single_estimator(
541542
else:
542543
indexes = full_indexes
543544

544-
self.single_estimator_ = self._fit_oof_estimator(
545+
single_estimator_ = self._fit_oof_estimator(
545546
clone(self.estimator),
546547
X,
547548
y,
@@ -550,6 +551,7 @@ def fit_single_estimator(
550551
**fit_params
551552
)
552553

554+
self.single_estimator_ = single_estimator_
553555
return self
554556

555557
def predict(

0 commit comments

Comments
 (0)