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:306] Using only one seed for deterministic scenario.
[INFO][abstract_intensifier.py:516] Added config 8add1e as new incumbent because there are no incumbents yet.
[INFO][abstract_intensifier.py:603] Config f89e79 is a new incumbent. Total number of incumbents: 2.
[INFO][abstract_intensifier.py:603] Config 56361f is a new incumbent. Total number of incumbents: 3.
[INFO][abstract_intensifier.py:603] Config 7aefc3 is a new incumbent. Total number of incumbents: 4.
[INFO][abstract_intensifier.py:603] Config 782220 is a new incumbent. Total number of incumbents: 5.
[INFO][abstract_intensifier.py:603] Config 2a28f3 is a new incumbent. Total number of incumbents: 6.
[INFO][abstract_intensifier.py:603] Config 062bb0 is a new incumbent. Total number of incumbents: 7.
[INFO][abstract_intensifier.py:603] Config e21d67 is a new incumbent. Total number of incumbents: 8.
[INFO][abstract_intensifier.py:603] Config b8c8c7 is a new incumbent. Total number of incumbents: 9.
[INFO][abstract_intensifier.py:603] Config 9f7283 is a new incumbent. Total number of incumbents: 10.
[INFO][abstract_intensifier.py:603] Config 02d260 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:628] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:603] Config 61b280 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:628] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:603] Config afbbd6 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:628] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:603] Config 14ad19 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:628] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:603] Config c4dadc is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:628] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:603] Config 7dbe83 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:628] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:603] Config 62fba9 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:628] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:603] Config 94a335 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:628] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:603] Config 2debdc is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:628] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:603] Config 060824 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:628] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:603] Config c5f0d0 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:628] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:603] Config 1832d5 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:628] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:603] Config 47d29c is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:628] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:603] Config f72c01 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:628] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:603] Config f00329 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:628] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:603] Config 190331 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:628] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:603] Config a22e5e is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:628] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:603] Config 1dc2d0 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:628] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:603] Config 20dbe0 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:628] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:603] Config d62656 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:628] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:603] Config f9906d is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:628] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:603] Config e2e90e is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:628] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:603] Config f7c77e is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:628] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:603] Config 3d4063 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:628] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:603] Config cc33a0 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:628] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:603] Config 69b72d is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:628] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:603] Config d75332 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:628] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:603] Config 088b75 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:628] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:603] Config 906e71 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:628] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:603] Config 9e7935 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:628] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:603] Config 82cb97 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:628] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:603] Config 6cac3e is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:628] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:603] Config 67196b is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:628] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:603] Config bfbb10 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:628] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:603] Config 4a9ab3 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:628] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:603] Config fece9a is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:628] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:603] Config b7e403 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:628] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:603] Config 055685 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:628] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:603] Config 5f71a3 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:628] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:603] Config 572a07 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:628] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][smbo.py:320] Finished 50 trials.
[INFO][abstract_intensifier.py:603] Config 66ffb9 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:628] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:603] Config a58bc0 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:628] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:603] Config 5847f7 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:628] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:603] Config 2961f8 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:628] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:603] Config d32200 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:628] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:603] Config cc3c1a is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:628] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:603] Config a775a5 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:628] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:603] Config cbedc3 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:628] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:603] Config 0f6515 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:628] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:603] Config a15d7d is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:628] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:603] Config bd5f71 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:628] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:603] Config 8c0797 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:628] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:603] Config 9c457d is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:628] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:603] Config bbffc8 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:628] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:603] Config 510455 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:628] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:603] Config 1c69a8 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:628] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:603] Config c66084 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:628] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:603] Config a3c344 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:628] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:603] Config 909d43 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:628] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:603] Config 53e1cd is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:628] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:603] Config 5eb321 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:628] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:603] Config de955b is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:628] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:603] Config 73d2b0 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:628] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:603] Config 2fb561 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:628] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:603] Config 2a45f4 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:628] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:603] Config 36152b is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:628] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:603] Config a313ed is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:628] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:603] Config d7ef91 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:628] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:603] Config e6b2a7 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:628] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:603] Config bd3479 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:628] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:603] Config f6bf85 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:628] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:603] Config 6d8679 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:628] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:603] Config afb418 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:628] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:603] Config 13665f is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:628] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:603] Config 14250b is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:628] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:603] Config 044d18 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:628] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:603] Config 3bff9e is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:628] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:603] Config 8a0acd is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:628] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:603] Config 9ae958 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:628] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:603] Config a17235 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:628] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:603] Config 039e91 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:628] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:603] Config 6019a9 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:628] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:603] Config 5d0706 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:628] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:603] Config a1a3b5 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:628] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:603] Config c365a6 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:628] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:603] Config 5573f6 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:628] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:603] Config 02a4d3 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:628] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:603] Config 94eb91 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:628] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:603] Config 8c0104 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:628] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:603] Config 51fa2d is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:628] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][smbo.py:320] Finished 100 trials.
[INFO][abstract_intensifier.py:603] Config 7c6557 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:628] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:603] Config 7abafe is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:628] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:603] Config b200d1 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:628] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:603] Config 008287 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:628] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:603] Config 15bef1 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:628] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:603] Config 504027 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:628] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:603] Config 6a2a90 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:628] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:603] Config a5344e is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:628] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:603] Config 33eb92 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:628] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:603] Config b68e48 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:628] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:603] Config e5a2c8 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:628] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:603] Config 8b8d5b is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:628] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:603] Config 181f09 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:628] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:603] Config f0f7fe is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:628] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:603] Config 0e9980 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:628] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:603] Config 59518c is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:628] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:603] Config 965bc8 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:628] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:603] Config 5e3d63 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:628] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:603] Config 83138b is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:628] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:603] Config 019d6e is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:628] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:603] Config 58d1ef is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:628] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:603] Config 0669c8 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:628] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:603] Config ee8f98 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:628] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:603] Config 66be6e is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:628] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:603] Config 99c8b0 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:628] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:603] Config 55f014 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:628] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:603] Config 21e7ec is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:628] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:603] Config dea35e is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:628] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:603] Config c059e1 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:628] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:603] Config a1b616 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:628] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:603] Config 509dbd is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:628] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:603] Config 9cc162 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:628] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:603] Config c07423 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:628] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:603] Config 8b48e6 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:628] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:603] Config 1a1726 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:628] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:603] Config 18d90b is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:628] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:603] Config 4f5fd5 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:628] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:603] Config 07d7b6 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:628] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:603] Config 4150cf is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:628] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:603] Config c844e7 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:628] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:603] Config 32406d is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:628] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:603] Config c68bca is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:628] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:603] Config e96570 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:628] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:603] Config cd4834 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:628] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:603] Config af7212 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:628] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:603] Config 564de3 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:628] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:603] Config 82d0b1 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:628] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:603] Config efd7ca is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:628] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:603] Config cafcd4 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:628] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:603] Config 0b79b5 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:628] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][smbo.py:320] Finished 150 trials.
[INFO][smbo.py:328] Configuration budget is exhausted:
[INFO][smbo.py:329] --- Remaining wallclock time: inf
[INFO][smbo.py:330] --- Remaining cpu time: inf
[INFO][smbo.py:331] --- 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):
--- [2.16611704e-04 3.94134567e+00]
--- [3.70257961 0.0057443 ]
--- [0.71275121 1.33576744]
--- [1.08151039 0.92168272]
--- [0.06098443 3.07318339]
--- [2.48235858 0.18015759]
--- [0.32529922 2.04389887]
--- [3.01424821 0.06961205]
--- [0.21382349 2.36418141]
--- [1.7133447 0.47755296]
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 8.421 seconds)