Skip to content

Commit

Permalink
disable boost on errors steps for custom validation strategy (#380)
Browse files Browse the repository at this point in the history
  • Loading branch information
pplonski committed Jun 3, 2024
1 parent 6aa1c3c commit d2a8d3a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
10 changes: 8 additions & 2 deletions supervised/tuner/mljar_tuner.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,8 +181,14 @@ def steps(self):
all_steps += ["features_selection"]
for i in range(self._hill_climbing_steps):
all_steps += [f"hill_climbing_{i+1}"]
if self._boost_on_errors and self._fairness_metric is None:
# we can tun boost on errors only if there is not fairness optimization
if (
self._boost_on_errors
and self._fairness_metric is None
and self._validation_strategy.get("validation_type", "") != "custom"
):
# we can turn boost on errors only if there is not fairness optimization
# boost on errors will not work for custom validation strategy
# because we cant assure that we have all samples in out-of-folds predictions
all_steps += ["boost_on_errors"]
if self._train_ensemble:
all_steps += ["ensemble"]
Expand Down
2 changes: 1 addition & 1 deletion supervised/validation/validator_custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def get_split(self, k, repeat=0):
validation_data = {
"X": X.iloc[validation_index],
"y": y.iloc[validation_index],
}
}
if sample_weight is not None:
train_data["sample_weight"] = sample_weight.iloc[train_index]
validation_data["sample_weight"] = sample_weight.iloc[validation_index]
Expand Down

0 comments on commit d2a8d3a

Please sign in to comment.