Note
Go to the end to download the full example code or to run this example in your browser via Binder
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:147] Using 10 initial design configurations and 0 additional configurations.
[INFO][abstract_intensifier.py:305] Using only one seed for deterministic scenario.
[INFO][abstract_intensifier.py:515] Added config 91bfd9 as new incumbent because there are no incumbents yet.
[INFO][abstract_intensifier.py:598] Config 9d232c is a new incumbent. Total number of incumbents: 2.
[INFO][abstract_intensifier.py:598] Config 427430 is a new incumbent. Total number of incumbents: 3.
[INFO][abstract_intensifier.py:598] Config 631e51 is a new incumbent. Total number of incumbents: 4.
[INFO][abstract_intensifier.py:598] Config c4bc7d is a new incumbent. Total number of incumbents: 5.
[INFO][abstract_intensifier.py:598] Config d25f7e is a new incumbent. Total number of incumbents: 6.
[INFO][abstract_intensifier.py:598] Config ddd02b is a new incumbent. Total number of incumbents: 7.
[INFO][abstract_intensifier.py:598] Config 89e67c is a new incumbent. Total number of incumbents: 8.
[INFO][abstract_intensifier.py:598] Config c22923 is a new incumbent. Total number of incumbents: 9.
[INFO][abstract_intensifier.py:598] Config 44c9c5 is a new incumbent. Total number of incumbents: 10.
[INFO][abstract_intensifier.py:598] Config ae3488 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:623] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:598] Config 055dc0 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:623] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:598] Config b6fd7c is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:623] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:598] Config e66eef is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:623] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:598] Config 3f38b6 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:623] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:598] Config 7a68da is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:623] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:598] Config 5b0023 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:623] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:598] Config be7be9 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:623] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:598] Config cf7b9e is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:623] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:598] Config 261ae6 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:623] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:598] Config 916981 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:623] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:598] Config a493de is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:623] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:598] Config 51f5b1 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:623] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:598] Config 5bb5d6 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:623] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:598] Config a0a42d is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:623] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:598] Config f5781e is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:623] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:598] Config cd512c is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:623] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:598] Config 52319d is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:623] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:598] Config 96258f is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:623] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:598] Config e458eb is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:623] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:598] Config 48e226 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:623] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:598] Config 925028 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:623] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:598] Config 400482 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:623] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:598] Config ea761d is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:623] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:598] Config 199e42 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:623] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:598] Config 1d89c9 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:623] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:598] Config 157dde is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:623] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:598] Config 4eabb2 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:623] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:598] Config 9f5bb9 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:623] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:598] Config 610e96 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:623] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:598] Config 792399 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:623] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:598] Config cd1a84 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:623] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:598] Config 143e8d is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:623] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:598] Config bc5507 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:623] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:598] Config d2073d is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:623] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:598] Config 6d39c3 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:623] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:598] Config 310f3d is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:623] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:598] Config ee50f0 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:623] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:598] Config 191396 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:623] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:598] Config aa13c9 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:623] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][smbo.py:319] Finished 50 trials.
[INFO][abstract_intensifier.py:598] Config 51c6a1 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:623] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:598] Config 6aa208 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:623] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:598] Config 7c08ce is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:623] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:598] Config 0f10be is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:623] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:598] Config baab59 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:623] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:598] Config 1118e9 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:623] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:598] Config 4abd42 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:623] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:598] Config 146491 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:623] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:598] Config d52695 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:623] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:598] Config 4f3e25 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:623] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:598] Config 6dfe14 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:623] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:598] Config ed4f3e is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:623] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:598] Config 5a3ff6 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:623] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:598] Config 37ee26 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:623] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:598] Config 1e385c is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:623] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:598] Config 460b13 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:623] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:598] Config efd57f is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:623] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:598] Config 4b3f4b is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:623] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:598] Config 37a50d is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:623] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:598] Config 49336c is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:623] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:598] Config c1bea5 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:623] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:598] Config e4f600 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:623] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:598] Config 8db6b9 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:623] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:598] Config 00947e is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:623] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:598] Config 7e03ee is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:623] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:598] Config e7652a is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:623] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:598] Config 5f1f68 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:623] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:598] Config c9a4ab is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:623] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:598] Config 26907e is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:623] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:598] Config f523f5 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:623] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:598] Config 940870 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:623] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:598] Config f21a6e is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:623] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:598] Config 04cf46 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:623] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:598] Config e3e1fc is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:623] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:598] Config 7cab7f is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:623] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:598] Config 4abdbb is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:623] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:598] Config 65680c is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:623] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:598] Config 257ec9 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:623] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:598] Config 0ffa3c is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:623] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:598] Config 3e7b8c is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:623] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:598] Config b61ca9 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:623] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:598] Config 1e70ce is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:623] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:598] Config 9621a8 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:623] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:598] Config 26d5a4 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:623] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:598] Config aa878c is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:623] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:598] Config c40c4c is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:623] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:598] Config a88778 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:623] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:598] Config 6e1528 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:623] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:598] Config 0e4ddc is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:623] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:598] Config 8ae00c is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:623] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][smbo.py:319] Finished 100 trials.
[INFO][abstract_intensifier.py:598] Config 2fb8e3 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:623] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:598] Config 313866 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:623] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:598] Config 9a849e is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:623] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:598] Config bf6ee6 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:623] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:598] Config 1c3721 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:623] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:598] Config d6acb8 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:623] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:598] Config 2e23af is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:623] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:598] Config d2a8ac is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:623] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:598] Config 49eabf is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:623] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:598] Config 17755d is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:623] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:598] Config e4515e is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:623] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:598] Config 3c0836 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:623] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:598] Config 657da4 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:623] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:598] Config 75e08e is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:623] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:598] Config 9ec620 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:623] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:598] Config 1b701e is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:623] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:598] Config 38990f is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:623] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:598] Config 9adac9 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:623] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:598] Config 9b50d4 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:623] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:598] Config eb89b7 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:623] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:598] Config 299174 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:623] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:598] Config 2ff038 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:623] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:598] Config 4d31e6 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:623] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:598] Config c00b70 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:623] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:598] Config 04b3b4 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:623] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:598] Config 4c851f is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:623] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:598] Config 1d8cc2 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:623] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:598] Config 74b413 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:623] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:598] Config ce98d7 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:623] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:598] Config 6635ed is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:623] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:598] Config 5448e7 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:623] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:598] Config 0f10d0 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:623] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:598] Config 409930 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:623] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:598] Config 39f1ae is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:623] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:598] Config 02e0b8 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:623] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:598] Config 5ebade is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:623] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:598] Config 0b0993 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:623] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:598] Config cd13ee is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:623] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:598] Config 04173b is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:623] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:598] Config 8d020c is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:623] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:598] Config 90b0e6 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:623] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:598] Config b5b43a is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:623] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:598] Config 6ef076 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:623] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:598] Config 174106 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:623] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:598] Config c5f14e is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:623] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:598] Config 5c0b56 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:623] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:598] Config 2b710a is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:623] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:598] Config 6a9164 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:623] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:598] Config a37eca is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:623] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:598] Config 29ed99 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:623] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][smbo.py:319] Finished 150 trials.
[INFO][smbo.py:327] Configuration budget is exhausted:
[INFO][smbo.py:328] --- Remaining wallclock time: inf
[INFO][smbo.py:329] --- Remaining cpu time: inf
[INFO][smbo.py:330] --- Remaining trials: 0
[INFO][abstract_intensifier.py:305] 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 11.080 seconds)