Note
Click here to download the full example code
2D Schaffer Function with Objective Weights¶
A simple example on how to use multi-objective optimization is shown. The 2D Schaffer function is used. In the plot you can see that all points are on the Pareto front. However, since we set the objective weights, you can notice that SMAC prioritizes the second objective over the first one.
[INFO][abstract_initial_design.py:134] Using 10 initial design configurations and 0 additional configurations.
[INFO][abstract_intensifier.py:306] Using only one seed for deterministic scenario.
[INFO][abstract_intensifier.py:493] Added config 8a8909 as new incumbent because there are no incumbents yet.
[INFO][abstract_intensifier.py:573] Config 3a64dd is a new incumbent. Total number of incumbents: 2.
[INFO][abstract_intensifier.py:573] Config c865cf is a new incumbent. Total number of incumbents: 3.
[INFO][abstract_intensifier.py:573] Config 9c7523 is a new incumbent. Total number of incumbents: 4.
[INFO][abstract_intensifier.py:573] Config 1c02c1 is a new incumbent. Total number of incumbents: 5.
[INFO][abstract_intensifier.py:573] Config 555ee4 is a new incumbent. Total number of incumbents: 6.
[INFO][abstract_intensifier.py:573] Config a21a9d is a new incumbent. Total number of incumbents: 7.
[INFO][abstract_intensifier.py:573] Config 726247 is a new incumbent. Total number of incumbents: 8.
[INFO][abstract_intensifier.py:573] Config 15d504 is a new incumbent. Total number of incumbents: 9.
[INFO][abstract_intensifier.py:573] Config 2b6ad4 is a new incumbent. Total number of incumbents: 10.
[INFO][abstract_intensifier.py:573] Config 914391 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:598] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:573] Config bf8bea is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:598] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:573] Config d05e80 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:598] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:573] Config df4cbd is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:598] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:573] Config 8ba166 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:598] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:573] Config a50db0 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:598] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:573] Config 346c91 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:598] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:573] Config c40dc1 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:598] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:573] Config 003ffb is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:598] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:573] Config 54cbf0 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:598] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:573] Config 478ad0 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:598] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:573] Config 74f0dd is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:598] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:573] Config ab860b is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:598] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:573] Config 460755 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:598] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:573] Config d94cdf is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:598] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:573] Config 178c1b is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:598] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:573] Config e7e8b7 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:598] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:573] Config 85de3f is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:598] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:573] Config e837bf is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:598] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:573] Config 2c9ff3 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:598] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:573] Config df9292 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:598] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:573] Config b3f2de is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:598] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:573] Config 7d5595 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:598] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:573] Config b9185b is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:598] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:573] Config b90a99 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:598] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:573] Config e4a69b is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:598] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:573] Config 4816bf is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:598] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:573] Config 4558f3 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:598] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:573] Config b50fcc is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:598] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:573] Config 1dc67b is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:598] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:573] Config 74d2ac is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:598] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:573] Config 6955fb is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:598] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:573] Config 977060 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:598] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:573] Config b0a618 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:598] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:573] Config 4e6b25 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:598] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:573] Config ce64ab is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:598] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:573] Config 85f2cf is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:598] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:573] Config 003f9a is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:598] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:573] Config af0c3f is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:598] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:573] Config 36e58e is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:598] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][smbo.py:298] Finished 50 trials.
[INFO][abstract_intensifier.py:573] Config 993356 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:598] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:573] Config 094fd4 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:598] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:573] Config 3ff59b is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:598] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:573] Config 36ae0d is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:598] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:573] Config ecb618 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:598] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:573] Config 0f8a3a is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:598] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:573] Config 6962d0 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:598] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:573] Config 782459 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:598] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:573] Config 80e42c is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:598] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:573] Config 1869d6 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:598] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:573] Config 456310 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:598] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:573] Config 0021ff is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:598] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:573] Config ea381b is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:598] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:573] Config 41b92b is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:598] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:573] Config 57f079 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:598] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:573] Config 25cbd8 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:598] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:573] Config 95052f is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:598] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:573] Config 70707c is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:598] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:573] Config f6e131 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:598] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:573] Config e1cf58 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:598] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:573] Config 584c42 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:598] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:573] Config 047685 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:598] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:573] Config b67a4d is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:598] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:573] Config 1e8dd4 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:598] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:573] Config 05127f is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:598] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:573] Config 7a4361 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:598] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:573] Config e7fcea is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:598] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:573] Config f8de06 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:598] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:573] Config 549803 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:598] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:573] Config 71481f is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:598] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:573] Config 232333 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:598] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:573] Config 5cb077 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:598] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:573] Config 6e86f8 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:598] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:573] Config b55ebe is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:598] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:573] Config ce7af0 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:598] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:573] Config 9718a3 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:598] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:573] Config 981229 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:598] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:573] Config 191e0a is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:598] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:573] Config 59c51b is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:598] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:573] Config 0ffdff is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:598] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:573] Config 35d45b is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:598] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:573] Config a7ed9e is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:598] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:573] Config 1bf099 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:598] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:573] Config 4925ae is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:598] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:573] Config 445f11 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:598] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:573] Config 181e78 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:598] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:573] Config f660f5 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:598] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:573] Config 8cb608 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:598] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:573] Config 25257b is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:598] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:573] Config 0c8f8e is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:598] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][smbo.py:298] Finished 100 trials.
[INFO][abstract_intensifier.py:573] Config d8ea27 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:598] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:573] Config fceb3d is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:598] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:573] Config 20d65b is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:598] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:573] Config cbca1d is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:598] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:573] Config f5155a is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:598] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:573] Config accc3c is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:598] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:573] Config ce9297 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:598] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:573] Config 81b9ac is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:598] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:573] Config 0c11a6 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:598] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:573] Config 5706ae is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:598] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:573] Config c81c9a is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:598] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:573] Config d14060 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:598] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:573] Config 481bd6 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:598] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:573] Config d74a3e is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:598] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:573] Config b80c96 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:598] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:573] Config 4e664e is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:598] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:573] Config cbcc66 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:598] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:573] Config 5dc22c is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:598] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:573] Config 98c70e is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:598] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:573] Config 206fc8 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:598] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:573] Config cedbe5 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:598] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:573] Config 5ce981 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:598] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:573] Config 3bfad0 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:598] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:573] Config 3b1777 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:598] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:573] Config bd5424 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:598] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:573] Config d710c6 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:598] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:573] Config 8f0869 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:598] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:573] Config 2715ad is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:598] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:573] Config 3bb3a3 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:598] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:573] Config 18173d is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:598] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:573] Config a3edd7 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:598] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:573] Config 3132a2 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:598] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:573] Config 86b17f is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:598] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:573] Config 9f4f72 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:598] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:573] Config 63b5d0 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:598] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:573] Config 8c6c08 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:598] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:573] Config ed3fe5 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:598] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:573] Config f741ba is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:598] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:573] Config 860fa6 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:598] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:573] Config 9c786d is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:598] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:573] Config c75780 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:598] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:573] Config c5167c is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:598] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:573] Config 33cfef is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:598] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:573] Config 854545 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:598] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:573] Config 97176f is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:598] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:573] Config ccdc50 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:598] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:573] Config 33c795 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:598] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:573] Config f33294 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:598] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:573] Config 82d292 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:598] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:573] Config 70f1b6 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:598] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][smbo.py:298] Finished 150 trials.
[INFO][smbo.py:306] Configuration budget is exhausted:
[INFO][smbo.py:307] --- Remaining wallclock time: inf
[INFO][smbo.py:308] --- Remaining cpu time: inf
[INFO][smbo.py:309] --- Remaining trials: 0
[INFO][abstract_intensifier.py:306] Using only one seed for deterministic scenario.
Validated costs from default config:
--- [0. 4.]
Validated costs from the Pareto front (incumbents):
--- [0.01538581 3.51922763]
--- [3.81477017e+00 2.19551629e-03]
--- [0.66494111 1.40318427]
--- [0.28063773 2.16162765]
--- [1.21948125 0.80227625]
--- [0.09228592 2.87714199]
--- [3.16368713 0.04898446]
--- [2.51598724 0.17124171]
--- [1.60303937 0.53859173]
--- [2.0255363 0.33268282]
from __future__ import annotations
from typing import Dict, Tuple
import numpy as np
from ConfigSpace import Configuration, ConfigurationSpace
from matplotlib import pyplot as plt
from smac import HyperparameterOptimizationFacade as HPOFacade
from smac import Scenario
from smac.facade import AbstractFacade
__copyright__ = "Copyright 2021, AutoML.org Freiburg-Hannover"
__license__ = "3-clause BSD"
def schaffer(x: float) -> Tuple[float, float]:
f1 = np.square(x)
f2 = np.square(np.sqrt(f1) - 2)
return f1, f2
def target_function(config: Configuration, seed: int = 0) -> Dict[str, float]:
f1, f2 = schaffer(config["x"])
return {"metric1": f1, "metric2": f2}
def plot_from_smac(smac: AbstractFacade) -> None:
plt.figure()
configs = smac.runhistory.get_configs()
incumbents = smac.intensifier.get_incumbents()
for i, config in enumerate(configs):
if config in incumbents:
continue
label = None
if i == 0:
label = "Configuration"
x = config["x"]
f1, f2 = schaffer(x)
plt.scatter(f1, f2, c="blue", alpha=0.1, marker="o", zorder=3000, label=label)
for i, config in enumerate(incumbents):
label = None
if i == 0:
label = "Incumbent"
x = config["x"]
f1, f2 = schaffer(x)
plt.scatter(f1, f2, c="red", alpha=1, marker="x", zorder=3000, label=label)
plt.xlabel("f1")
plt.ylabel("f2")
plt.title("Schaffer 2D")
plt.legend()
plt.show()
if __name__ == "__main__":
# Simple configspace
cs = ConfigurationSpace({"x": (-2.0, 2.0)})
# Scenario object
scenario = Scenario(
configspace=cs,
deterministic=True, # Only one seed
n_trials=150,
objectives=["metric1", "metric2"],
)
smac = HPOFacade(
scenario=scenario,
target_function=target_function,
multi_objective_algorithm=HPOFacade.get_multi_objective_algorithm(
scenario,
objective_weights=[1, 2], # Weight metric2 twice as much as metric1
),
overwrite=True,
)
incumbents = smac.optimize()
# Get cost of default configuration
default_cost = smac.validate(cs.get_default_configuration())
print(f"Validated costs from default config: \n--- {default_cost}\n")
print("Validated costs from the Pareto front (incumbents):")
for incumbent in incumbents:
cost = smac.validate(incumbent)
print("---", cost)
# Plot the evaluated points
plot_from_smac(smac)
Total running time of the script: ( 0 minutes 13.505 seconds)