Skip to content

Commit 0ba05e9

Browse files
committed
Rename methods to be Pareto set methods
1 parent d8a863c commit 0ba05e9

File tree

5 files changed

+16
-16
lines changed

5 files changed

+16
-16
lines changed

autosklearn/automl.py

+8-8
Original file line numberDiff line numberDiff line change
@@ -1651,9 +1651,9 @@ def _load_best_individual_model(self):
16511651
)
16521652
return ensemble
16531653

1654-
def _load_pareto_front(self) -> Sequence[VotingClassifier | VotingRegressor]:
1654+
def _load_pareto_set(self) -> Sequence[VotingClassifier | VotingRegressor]:
16551655
if len(self._metrics) <= 1:
1656-
raise ValueError("Pareto front is only available for two or more metrics.")
1656+
raise ValueError("Pareto set is only available for two or more metrics.")
16571657

16581658
if self._ensemble_class is not None:
16591659
self.ensemble_ = self._backend.load_ensemble(self._seed)
@@ -1664,22 +1664,22 @@ def _load_pareto_front(self) -> Sequence[VotingClassifier | VotingRegressor]:
16641664
if not self.ensemble_:
16651665

16661666
raise ValueError(
1667-
"Pareto front can only be accessed if an ensemble is available."
1667+
"Pareto set can only be accessed if an ensemble is available."
16681668
)
16691669

16701670
if isinstance(self.ensemble_, AbstractMultiObjectiveEnsemble):
1671-
pareto_front = self.ensemble_.get_pareto_front()
1671+
pareto_set = self.ensemble_.get_pareto_set()
16721672
else:
16731673
self._logger.warning(
1674-
"Pareto front not available for single objective ensemble "
1675-
"method. The Pareto front will only include the single ensemble "
1674+
"Pareto set not available for single objective ensemble "
1675+
"method. The Pareto set will only include the single ensemble "
16761676
"constructed by %s",
16771677
type(self.ensemble_),
16781678
)
1679-
pareto_front = [self.ensemble_]
1679+
pareto_set = [self.ensemble_]
16801680

16811681
ensembles = []
1682-
for ensemble in pareto_front:
1682+
for ensemble in pareto_set:
16831683
identifiers = ensemble.get_selected_model_identifiers()
16841684
weights = {
16851685
identifier: weight

autosklearn/ensembles/abstract_ensemble.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -140,5 +140,5 @@ def get_validation_performance(self) -> float:
140140

141141

142142
class AbstractMultiObjectiveEnsemble(AbstractEnsemble):
143-
def get_pareto_front(self) -> Sequence[AbstractEnsemble]:
143+
def get_pareto_set(self) -> Sequence[AbstractEnsemble]:
144144
pass

autosklearn/estimators.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1322,8 +1322,8 @@ def get_configuration_space(
13221322
else self.automl_.configuration_space
13231323
)
13241324

1325-
def get_pareto_front(self) -> Sequence[VotingClassifier | VotingRegressor]:
1326-
return self.automl_._load_pareto_front()
1325+
def get_pareto_set(self) -> Sequence[VotingClassifier | VotingRegressor]:
1326+
return self.automl_._load_pareto_set()
13271327

13281328

13291329
class AutoSklearnClassifier(AutoSklearnEstimator, ClassifierMixin):

examples/40_advanced/example_multi_objective.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
in the `scikit-learn docs <https://scikit-learn.org/stable/auto_examples/model_selection/plot_precision_recall.html>`_.
1010
1111
Auto-sklearn uses `SMAC3's implementation of ParEGO <https://automl.github.io/SMAC3/main/details/multi_objective.html>`_.
12-
Multi-objective ensembling and proper access to the full Pareto front will be added in the near
12+
Multi-objective ensembling and proper access to the full Pareto set will be added in the near
1313
future.
1414
"""
1515
from pprint import pprint
@@ -71,10 +71,10 @@
7171
pprint(automl.cv_results_)
7272

7373
############################################################################
74-
# Visualize the Pareto front
74+
# Visualize the Pareto set
7575
# ==========================
7676
plot_values = []
77-
pareto_front = automl.get_pareto_front()
77+
pareto_front = automl.get_pareto_set()
7878
for ensemble in pareto_front:
7979
predictions = ensemble.predict(X_test)
8080
precision = sklearn.metrics.precision_score(y_test, predictions)
@@ -86,5 +86,5 @@
8686
ax.scatter(precision, recall, c="blue")
8787
ax.set_xlabel("Precision")
8888
ax.set_ylabel("Recall")
89-
ax.set_title("Pareto front")
89+
ax.set_title("Pareto set")
9090
plt.show()

test/test_automl/test_post_fit.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ def test__load_pareto_front(automl: AutoML) -> None:
9090
assert automl.predict_proba(X).shape == (1, 3)
9191
assert automl.predict(X).shape == (1,)
9292

93-
pareto_front = automl._load_pareto_front()
93+
pareto_front = automl._load_pareto_set()
9494
assert len(pareto_front) == 1
9595
for ensemble in pareto_front:
9696
assert isinstance(ensemble, (VotingClassifier, VotingRegressor))

0 commit comments

Comments
 (0)