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:602] Config 9d232c is a new incumbent. Total number of incumbents: 2.
[INFO][abstract_intensifier.py:602] Config 427430 is a new incumbent. Total number of incumbents: 3.
[INFO][abstract_intensifier.py:602] Config 631e51 is a new incumbent. Total number of incumbents: 4.
[INFO][abstract_intensifier.py:602] Config c4bc7d is a new incumbent. Total number of incumbents: 5.
[INFO][abstract_intensifier.py:602] Config d25f7e is a new incumbent. Total number of incumbents: 6.
[INFO][abstract_intensifier.py:602] Config ddd02b is a new incumbent. Total number of incumbents: 7.
[INFO][abstract_intensifier.py:602] Config 89e67c is a new incumbent. Total number of incumbents: 8.
[INFO][abstract_intensifier.py:602] Config c22923 is a new incumbent. Total number of incumbents: 9.
[INFO][abstract_intensifier.py:602] Config 44c9c5 is a new incumbent. Total number of incumbents: 10.
[INFO][abstract_intensifier.py:602] Config 52ad27 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:627] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:602] Config 591306 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:627] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:602] Config 7cf354 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:627] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:602] Config 78cd53 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:627] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:602] Config 50b29b is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:627] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:602] Config dc7dee is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:627] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:602] Config 11d305 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:627] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:602] Config c284f2 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:627] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:602] Config 3301f2 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:627] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:602] Config ed629c is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:627] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:602] Config 9f0e84 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:627] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:602] Config ed19a5 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:627] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:602] Config 1df92e is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:627] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:602] Config 1f3477 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:627] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:602] Config 795280 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:627] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:602] Config bb24df is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:627] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:602] Config 137256 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:627] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:602] Config f3c23b is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:627] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:602] Config e8a37c is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:627] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:602] Config be5418 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:627] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:602] Config 4431ec is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:627] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:602] Config fe2841 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:627] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:602] Config afefef is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:627] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:602] Config 2dc22a is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:627] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:602] Config 6718e9 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:627] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:602] Config 894517 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:627] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:602] Config 8d742e is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:627] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:602] Config 184825 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:627] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:602] Config 786a51 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:627] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:602] Config 1276c6 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:627] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:602] Config 39d7fb is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:627] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:602] Config 85f0af is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:627] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:602] Config c13402 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:627] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:602] Config 67ed09 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:627] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:602] Config 401148 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:627] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:602] Config 94ea8a is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:627] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:602] Config 5efb80 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:627] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:602] Config dc0cd8 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:627] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:602] Config 814da4 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:627] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:602] Config 45fd01 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:627] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][smbo.py:319] Finished 50 trials.
[INFO][abstract_intensifier.py:602] Config 4891db is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:627] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:602] Config 5d4ba2 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:627] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:602] Config 8ac7b9 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:627] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:602] Config a21384 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:627] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:602] Config 860188 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:627] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:602] Config c31df1 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:627] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:602] Config 381e14 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:627] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:602] Config a7b2c5 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:627] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:602] Config 36aac3 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:627] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:602] Config 7f755d is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:627] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:602] Config e990dd is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:627] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:602] Config 90e199 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:627] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:602] Config 9c6906 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:627] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:602] Config ff709c is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:627] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:602] Config 4687bd is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:627] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:602] Config c287f1 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:627] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:602] Config 1ee992 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:627] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:602] Config 353acf is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:627] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:602] Config 3f4152 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:627] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:602] Config 426c34 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:627] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:602] Config 3df2e2 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:627] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:602] Config 81ee7b is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:627] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:602] Config 3e3235 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:627] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:602] Config f5d5f9 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:627] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:602] Config 2e6e80 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:627] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:602] Config c1d379 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:627] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:602] Config 28c9f9 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:627] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:602] Config b19632 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:627] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:602] Config 022fca is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:627] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:602] Config 659942 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:627] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:602] Config d4166e is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:627] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:602] Config db0045 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:627] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:602] Config f3c025 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:627] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:602] Config 7edcd1 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:627] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:602] Config fec302 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:627] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:602] Config ce9ad7 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:627] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:602] Config 7ef5b0 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:627] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:602] Config 7268bc is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:627] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:602] Config e4debe is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:627] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:602] Config c7a507 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:627] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:602] Config ab179e is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:627] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:602] Config 2cb75c is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:627] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:602] Config d5d1f3 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:627] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:602] Config 922896 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:627] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:602] Config ff3901 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:627] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:602] Config 53c9bc is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:627] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:602] Config 190413 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:627] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:602] Config bd5027 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:627] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:602] Config 4ba6ad is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:627] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:602] Config 5f1f97 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:627] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][smbo.py:319] Finished 100 trials.
[INFO][abstract_intensifier.py:602] Config 663b3d is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:627] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:602] Config 7c9235 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:627] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:602] Config 7d4910 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:627] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:602] Config 40ecfc is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:627] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:602] Config 47e5f6 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:627] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:602] Config c7846c is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:627] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:602] Config 2be60e is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:627] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:602] Config 932722 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:627] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:602] Config a96569 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:627] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:602] Config e06ac3 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:627] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:602] Config b03e1a is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:627] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:602] Config 1c22be is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:627] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:602] Config b6f791 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:627] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:602] Config eed864 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:627] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:602] Config 68f8e1 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:627] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:602] Config 143b21 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:627] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:602] Config 636811 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:627] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:602] Config a8a5e7 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:627] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:602] Config 892676 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:627] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:602] Config e4c3a3 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:627] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:602] Config bf189c is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:627] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:602] Config dc55be is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:627] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:602] Config e591ad is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:627] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:602] Config 75dedd is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:627] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:602] Config eb4be3 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:627] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:602] Config d645c9 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:627] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:602] Config 850f72 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:627] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:602] Config 67f6e7 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:627] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:602] Config 61be50 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:627] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:602] Config e19804 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:627] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:602] Config 1eac88 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:627] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:602] Config 5dcf41 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:627] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:602] Config e149ee is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:627] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:602] Config 501a6b is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:627] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:602] Config 2942cc is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:627] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:602] Config 65debb is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:627] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:602] Config aa0986 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:627] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:602] Config b2d235 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:627] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:602] Config b10fe9 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:627] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:602] Config b6e2c1 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:627] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:602] Config f69e52 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:627] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:602] Config 989599 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:627] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:602] Config 61206b is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:627] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:602] Config 1377ef is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:627] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:602] Config e6c407 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:627] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:602] Config 4097ee is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:627] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:602] Config 902c13 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:627] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:602] Config bb0bce is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:627] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:602] Config 5b27dc is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:627] Removed one incumbent using crowding distance because more than 10 are available.
[INFO][abstract_intensifier.py:602] Config c20683 is a new incumbent. Total number of incumbents: 11.
[INFO][abstract_intensifier.py:627] 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.94960333e+00 1.59746979e-04]
--- [0.13155096 2.68075279]
--- [0.39731087 1.87600685]
--- [0.74709967 1.28970257]
--- [1.10116174 0.90371158]
--- [2.57585333 0.15606725]
--- [3.26694769 0.03706781]
--- [1.58831296 0.5471814 ]
--- [2.0180713 0.33571785]
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.418 seconds)