{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Multi Objective Loading BOA from JSON and Plotting Results\n", "\n", "This notebook demonstrates how to:\n", "\n", "Loading a Scheduler from JSON from a multi objective optimization previous run (If you want to see the Experiment that this is from, see [Running a Multi Objective Optimization Directly in Python](1moo_optimization_run.ipynb). We will look at the output and plot some exploratory data analysis." ] }, { "cell_type": "code", "execution_count": 1, "metadata": { "tags": [] }, "outputs": [ { "data": { "application/javascript": [ "(function(root) {\n", " function now() {\n", " return new Date();\n", " }\n", "\n", " var force = true;\n", "\n", " if (typeof root._bokeh_onload_callbacks === \"undefined\" || force === true) {\n", " root._bokeh_onload_callbacks = [];\n", " root._bokeh_is_loading = undefined;\n", " }\n", "\n", " if (typeof (root._bokeh_timeout) === \"undefined\" || force === true) {\n", " root._bokeh_timeout = Date.now() + 5000;\n", " root._bokeh_failed_load = false;\n", " }\n", "\n", " function run_callbacks() {\n", " try {\n", " root._bokeh_onload_callbacks.forEach(function(callback) {\n", " if (callback != null)\n", " callback();\n", " });\n", " } finally {\n", " delete root._bokeh_onload_callbacks\n", " }\n", " console.debug(\"Bokeh: all callbacks have finished\");\n", " }\n", "\n", " function load_libs(css_urls, js_urls, js_modules, callback) {\n", " if (css_urls == null) css_urls = [];\n", " if (js_urls == null) js_urls = [];\n", " if (js_modules == null) js_modules = [];\n", "\n", " root._bokeh_onload_callbacks.push(callback);\n", " if (root._bokeh_is_loading > 0) {\n", " console.debug(\"Bokeh: BokehJS is being loaded, scheduling callback at\", now());\n", " return null;\n", " }\n", " if (js_urls.length === 0 && js_modules.length === 0) {\n", " run_callbacks();\n", " return null;\n", " }\n", " console.debug(\"Bokeh: BokehJS not loaded, scheduling load and callback at\", now());\n", "\n", " function on_load() {\n", " root._bokeh_is_loading--;\n", " if (root._bokeh_is_loading === 0) {\n", " console.debug(\"Bokeh: all BokehJS libraries/stylesheets loaded\");\n", " run_callbacks()\n", " }\n", " }\n", "\n", " function on_error() {\n", " console.error(\"failed to load \" + url);\n", " }\n", "\n", " for (var i = 0; i < css_urls.length; i++) {\n", " var url = css_urls[i];\n", " const element = document.createElement(\"link\");\n", " element.onload = on_load;\n", " element.onerror = on_error;\n", " element.rel = \"stylesheet\";\n", " element.type = \"text/css\";\n", " element.href = url;\n", " console.debug(\"Bokeh: injecting link tag for BokehJS stylesheet: \", url);\n", " document.body.appendChild(element);\n", " }\n", "\n", " var skip = [];\n", " if (window.requirejs) {\n", " window.requirejs.config({'packages': {}, 'paths': {'plotly': 'https://cdn.plot.ly/plotly-2.18.0.min', 'gridstack': 'https://cdn.jsdelivr.net/npm/gridstack@4.2.5/dist/gridstack-h5', 'notyf': 'https://cdn.jsdelivr.net/npm/notyf@3/notyf.min'}, 'shim': {'gridstack': {'exports': 'GridStack'}}});\n", " require([\"plotly\"], function(Plotly) {\n", "\twindow.Plotly = Plotly\n", "\ton_load()\n", " })\n", " require([\"gridstack\"], function(GridStack) {\n", "\twindow.GridStack = GridStack\n", "\ton_load()\n", " })\n", " require([\"notyf\"], function() {\n", "\ton_load()\n", " })\n", " root._bokeh_is_loading = css_urls.length + 3;\n", " } else {\n", " root._bokeh_is_loading = css_urls.length + js_urls.length + js_modules.length;\n", " } if (((window['Plotly'] !== undefined) && (!(window['Plotly'] instanceof HTMLElement))) || window.requirejs) {\n", " var urls = ['https://cdn.holoviz.org/panel/0.14.4/dist/bundled/plotlyplot/plotly-2.18.0.min.js'];\n", " for (var i = 0; i < urls.length; i++) {\n", " skip.push(urls[i])\n", " }\n", " } if (((window['GridStack'] !== undefined) && (!(window['GridStack'] instanceof HTMLElement))) || window.requirejs) {\n", " var urls = ['https://cdn.holoviz.org/panel/0.14.4/dist/bundled/gridstack/gridstack@4.2.5/dist/gridstack-h5.js'];\n", " for (var i = 0; i < urls.length; i++) {\n", " skip.push(urls[i])\n", " }\n", " } if (((window['Notyf'] !== undefined) && (!(window['Notyf'] instanceof HTMLElement))) || window.requirejs) {\n", " var urls = ['https://cdn.holoviz.org/panel/0.14.4/dist/bundled/notificationarea/notyf@3/notyf.min.js'];\n", " for (var i = 0; i < urls.length; i++) {\n", " skip.push(urls[i])\n", " }\n", " } for (var i = 0; i < js_urls.length; i++) {\n", " var url = js_urls[i];\n", " if (skip.indexOf(url) >= 0) {\n", "\tif (!window.requirejs) {\n", "\t on_load();\n", "\t}\n", "\tcontinue;\n", " }\n", " var element = document.createElement('script');\n", " element.onload = on_load;\n", " element.onerror = on_error;\n", " element.async = false;\n", " element.src = url;\n", " console.debug(\"Bokeh: injecting script tag for BokehJS library: \", url);\n", " document.head.appendChild(element);\n", " }\n", " for (var i = 0; i < js_modules.length; i++) {\n", " var url = js_modules[i];\n", " if (skip.indexOf(url) >= 0) {\n", "\tif (!window.requirejs) {\n", "\t on_load();\n", "\t}\n", "\tcontinue;\n", " }\n", " var element = document.createElement('script');\n", " element.onload = on_load;\n", " element.onerror = on_error;\n", " element.async = false;\n", " element.src = url;\n", " element.type = \"module\";\n", " console.debug(\"Bokeh: injecting script tag for BokehJS library: \", url);\n", " document.head.appendChild(element);\n", " }\n", " if (!js_urls.length && !js_modules.length) {\n", " on_load()\n", " }\n", " };\n", "\n", " function inject_raw_css(css) {\n", " const element = document.createElement(\"style\");\n", " element.appendChild(document.createTextNode(css));\n", " document.body.appendChild(element);\n", " }\n", "\n", " var js_urls = [\"https://cdn.holoviz.org/panel/0.14.4/dist/bundled/jquery/jquery.slim.min.js\", \"https://cdn.holoviz.org/panel/0.14.4/dist/bundled/plotlyplot/plotly-2.18.0.min.js\", \"https://cdn.bokeh.org/bokeh/release/bokeh-2.4.3.min.js\", \"https://cdn.bokeh.org/bokeh/release/bokeh-gl-2.4.3.min.js\", \"https://cdn.bokeh.org/bokeh/release/bokeh-widgets-2.4.3.min.js\", \"https://cdn.bokeh.org/bokeh/release/bokeh-tables-2.4.3.min.js\", \"https://cdn.bokeh.org/bokeh/release/bokeh-mathjax-2.4.3.min.js\", \"https://unpkg.com/@holoviz/panel@0.14.4/dist/panel.min.js\"];\n", " var js_modules = [];\n", " var css_urls = [\"https://cdn.holoviz.org/panel/0.14.4/dist/css/debugger.css\", \"https://cdn.holoviz.org/panel/0.14.4/dist/css/alerts.css\", \"https://cdn.holoviz.org/panel/0.14.4/dist/css/card.css\", \"https://cdn.holoviz.org/panel/0.14.4/dist/css/widgets.css\", \"https://cdn.holoviz.org/panel/0.14.4/dist/css/markdown.css\", \"https://cdn.holoviz.org/panel/0.14.4/dist/css/json.css\", \"https://cdn.holoviz.org/panel/0.14.4/dist/css/loading.css\", \"https://cdn.holoviz.org/panel/0.14.4/dist/css/dataframe.css\"];\n", " var inline_js = [ function(Bokeh) {\n", " inject_raw_css(\"\\n .bk.pn-loading.arc:before {\\n background-image: url(\\\"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHN0eWxlPSJtYXJnaW46IGF1dG87IGJhY2tncm91bmQ6IG5vbmU7IGRpc3BsYXk6IGJsb2NrOyBzaGFwZS1yZW5kZXJpbmc6IGF1dG87IiB2aWV3Qm94PSIwIDAgMTAwIDEwMCIgcHJlc2VydmVBc3BlY3RSYXRpbz0ieE1pZFlNaWQiPiAgPGNpcmNsZSBjeD0iNTAiIGN5PSI1MCIgZmlsbD0ibm9uZSIgc3Ryb2tlPSIjYzNjM2MzIiBzdHJva2Utd2lkdGg9IjEwIiByPSIzNSIgc3Ryb2tlLWRhc2hhcnJheT0iMTY0LjkzMzYxNDMxMzQ2NDE1IDU2Ljk3Nzg3MTQzNzgyMTM4Ij4gICAgPGFuaW1hdGVUcmFuc2Zvcm0gYXR0cmlidXRlTmFtZT0idHJhbnNmb3JtIiB0eXBlPSJyb3RhdGUiIHJlcGVhdENvdW50PSJpbmRlZmluaXRlIiBkdXI9IjFzIiB2YWx1ZXM9IjAgNTAgNTA7MzYwIDUwIDUwIiBrZXlUaW1lcz0iMDsxIj48L2FuaW1hdGVUcmFuc2Zvcm0+ICA8L2NpcmNsZT48L3N2Zz4=\\\");\\n background-size: auto calc(min(50%, 400px));\\n }\\n \");\n", " }, function(Bokeh) {\n", " Bokeh.set_log_level(\"info\");\n", " },\n", "function(Bokeh) {} // ensure no trailing comma for IE\n", " ];\n", "\n", " function run_inline_js() {\n", " if ((root.Bokeh !== undefined) || (force === true)) {\n", " for (var i = 0; i < inline_js.length; i++) {\n", " inline_js[i].call(root, root.Bokeh);\n", " }} else if (Date.now() < root._bokeh_timeout) {\n", " setTimeout(run_inline_js, 100);\n", " } else if (!root._bokeh_failed_load) {\n", " console.log(\"Bokeh: BokehJS failed to load within specified timeout.\");\n", " root._bokeh_failed_load = true;\n", " }\n", " }\n", "\n", " if (root._bokeh_is_loading === 0) {\n", " console.debug(\"Bokeh: BokehJS loaded, going straight to plotting\");\n", " run_inline_js();\n", " } else {\n", " load_libs(css_urls, js_urls, js_modules, function() {\n", " console.debug(\"Bokeh: BokehJS plotting callback run at\", now());\n", " run_inline_js();\n", " });\n", " }\n", "}(window));" ], "application/vnd.holoviews_load.v0+json": "(function(root) {\n function now() {\n return new Date();\n }\n\n var force = true;\n\n if (typeof root._bokeh_onload_callbacks === \"undefined\" || force === true) {\n root._bokeh_onload_callbacks = [];\n root._bokeh_is_loading = undefined;\n }\n\n if (typeof (root._bokeh_timeout) === \"undefined\" || force === true) {\n root._bokeh_timeout = Date.now() + 5000;\n root._bokeh_failed_load = false;\n }\n\n function run_callbacks() {\n try {\n root._bokeh_onload_callbacks.forEach(function(callback) {\n if (callback != null)\n callback();\n });\n } finally {\n delete root._bokeh_onload_callbacks\n }\n console.debug(\"Bokeh: all callbacks have finished\");\n }\n\n function load_libs(css_urls, js_urls, js_modules, callback) {\n if (css_urls == null) css_urls = [];\n if (js_urls == null) js_urls = [];\n if (js_modules == null) js_modules = [];\n\n root._bokeh_onload_callbacks.push(callback);\n if (root._bokeh_is_loading > 0) {\n console.debug(\"Bokeh: BokehJS is being loaded, scheduling callback at\", now());\n return null;\n }\n if (js_urls.length === 0 && js_modules.length === 0) {\n run_callbacks();\n return null;\n }\n console.debug(\"Bokeh: BokehJS not loaded, scheduling load and callback at\", now());\n\n function on_load() {\n root._bokeh_is_loading--;\n if (root._bokeh_is_loading === 0) {\n console.debug(\"Bokeh: all BokehJS libraries/stylesheets loaded\");\n run_callbacks()\n }\n }\n\n function on_error() {\n console.error(\"failed to load \" + url);\n }\n\n for (var i = 0; i < css_urls.length; i++) {\n var url = css_urls[i];\n const element = document.createElement(\"link\");\n element.onload = on_load;\n element.onerror = on_error;\n element.rel = \"stylesheet\";\n element.type = \"text/css\";\n element.href = url;\n console.debug(\"Bokeh: injecting link tag for BokehJS stylesheet: \", url);\n document.body.appendChild(element);\n }\n\n var skip = [];\n if (window.requirejs) {\n window.requirejs.config({'packages': {}, 'paths': {'plotly': 'https://cdn.plot.ly/plotly-2.18.0.min', 'gridstack': 'https://cdn.jsdelivr.net/npm/gridstack@4.2.5/dist/gridstack-h5', 'notyf': 'https://cdn.jsdelivr.net/npm/notyf@3/notyf.min'}, 'shim': {'gridstack': {'exports': 'GridStack'}}});\n require([\"plotly\"], function(Plotly) {\n\twindow.Plotly = Plotly\n\ton_load()\n })\n require([\"gridstack\"], function(GridStack) {\n\twindow.GridStack = GridStack\n\ton_load()\n })\n require([\"notyf\"], function() {\n\ton_load()\n })\n root._bokeh_is_loading = css_urls.length + 3;\n } else {\n root._bokeh_is_loading = css_urls.length + js_urls.length + js_modules.length;\n } if (((window['Plotly'] !== undefined) && (!(window['Plotly'] instanceof HTMLElement))) || window.requirejs) {\n var urls = ['https://cdn.holoviz.org/panel/0.14.4/dist/bundled/plotlyplot/plotly-2.18.0.min.js'];\n for (var i = 0; i < urls.length; i++) {\n skip.push(urls[i])\n }\n } if (((window['GridStack'] !== undefined) && (!(window['GridStack'] instanceof HTMLElement))) || window.requirejs) {\n var urls = ['https://cdn.holoviz.org/panel/0.14.4/dist/bundled/gridstack/gridstack@4.2.5/dist/gridstack-h5.js'];\n for (var i = 0; i < urls.length; i++) {\n skip.push(urls[i])\n }\n } if (((window['Notyf'] !== undefined) && (!(window['Notyf'] instanceof HTMLElement))) || window.requirejs) {\n var urls = ['https://cdn.holoviz.org/panel/0.14.4/dist/bundled/notificationarea/notyf@3/notyf.min.js'];\n for (var i = 0; i < urls.length; i++) {\n skip.push(urls[i])\n }\n } for (var i = 0; i < js_urls.length; i++) {\n var url = js_urls[i];\n if (skip.indexOf(url) >= 0) {\n\tif (!window.requirejs) {\n\t on_load();\n\t}\n\tcontinue;\n }\n var element = document.createElement('script');\n element.onload = on_load;\n element.onerror = on_error;\n element.async = false;\n element.src = url;\n console.debug(\"Bokeh: injecting script tag for BokehJS library: \", url);\n document.head.appendChild(element);\n }\n for (var i = 0; i < js_modules.length; i++) {\n var url = js_modules[i];\n if (skip.indexOf(url) >= 0) {\n\tif (!window.requirejs) {\n\t on_load();\n\t}\n\tcontinue;\n }\n var element = document.createElement('script');\n element.onload = on_load;\n element.onerror = on_error;\n element.async = false;\n element.src = url;\n element.type = \"module\";\n console.debug(\"Bokeh: injecting script tag for BokehJS library: \", url);\n document.head.appendChild(element);\n }\n if (!js_urls.length && !js_modules.length) {\n on_load()\n }\n };\n\n function inject_raw_css(css) {\n const element = document.createElement(\"style\");\n element.appendChild(document.createTextNode(css));\n document.body.appendChild(element);\n }\n\n var js_urls = [\"https://cdn.holoviz.org/panel/0.14.4/dist/bundled/jquery/jquery.slim.min.js\", \"https://cdn.holoviz.org/panel/0.14.4/dist/bundled/plotlyplot/plotly-2.18.0.min.js\", \"https://cdn.bokeh.org/bokeh/release/bokeh-2.4.3.min.js\", \"https://cdn.bokeh.org/bokeh/release/bokeh-gl-2.4.3.min.js\", \"https://cdn.bokeh.org/bokeh/release/bokeh-widgets-2.4.3.min.js\", \"https://cdn.bokeh.org/bokeh/release/bokeh-tables-2.4.3.min.js\", \"https://cdn.bokeh.org/bokeh/release/bokeh-mathjax-2.4.3.min.js\", \"https://unpkg.com/@holoviz/panel@0.14.4/dist/panel.min.js\"];\n var js_modules = [];\n var css_urls = [\"https://cdn.holoviz.org/panel/0.14.4/dist/css/debugger.css\", \"https://cdn.holoviz.org/panel/0.14.4/dist/css/alerts.css\", \"https://cdn.holoviz.org/panel/0.14.4/dist/css/card.css\", \"https://cdn.holoviz.org/panel/0.14.4/dist/css/widgets.css\", \"https://cdn.holoviz.org/panel/0.14.4/dist/css/markdown.css\", \"https://cdn.holoviz.org/panel/0.14.4/dist/css/json.css\", \"https://cdn.holoviz.org/panel/0.14.4/dist/css/loading.css\", \"https://cdn.holoviz.org/panel/0.14.4/dist/css/dataframe.css\"];\n var inline_js = [ function(Bokeh) {\n inject_raw_css(\"\\n .bk.pn-loading.arc:before {\\n background-image: url(\\\"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHN0eWxlPSJtYXJnaW46IGF1dG87IGJhY2tncm91bmQ6IG5vbmU7IGRpc3BsYXk6IGJsb2NrOyBzaGFwZS1yZW5kZXJpbmc6IGF1dG87IiB2aWV3Qm94PSIwIDAgMTAwIDEwMCIgcHJlc2VydmVBc3BlY3RSYXRpbz0ieE1pZFlNaWQiPiAgPGNpcmNsZSBjeD0iNTAiIGN5PSI1MCIgZmlsbD0ibm9uZSIgc3Ryb2tlPSIjYzNjM2MzIiBzdHJva2Utd2lkdGg9IjEwIiByPSIzNSIgc3Ryb2tlLWRhc2hhcnJheT0iMTY0LjkzMzYxNDMxMzQ2NDE1IDU2Ljk3Nzg3MTQzNzgyMTM4Ij4gICAgPGFuaW1hdGVUcmFuc2Zvcm0gYXR0cmlidXRlTmFtZT0idHJhbnNmb3JtIiB0eXBlPSJyb3RhdGUiIHJlcGVhdENvdW50PSJpbmRlZmluaXRlIiBkdXI9IjFzIiB2YWx1ZXM9IjAgNTAgNTA7MzYwIDUwIDUwIiBrZXlUaW1lcz0iMDsxIj48L2FuaW1hdGVUcmFuc2Zvcm0+ICA8L2NpcmNsZT48L3N2Zz4=\\\");\\n background-size: auto calc(min(50%, 400px));\\n }\\n \");\n }, function(Bokeh) {\n Bokeh.set_log_level(\"info\");\n },\nfunction(Bokeh) {} // ensure no trailing comma for IE\n ];\n\n function run_inline_js() {\n if ((root.Bokeh !== undefined) || (force === true)) {\n for (var i = 0; i < inline_js.length; i++) {\n inline_js[i].call(root, root.Bokeh);\n }} else if (Date.now() < root._bokeh_timeout) {\n setTimeout(run_inline_js, 100);\n } else if (!root._bokeh_failed_load) {\n console.log(\"Bokeh: BokehJS failed to load within specified timeout.\");\n root._bokeh_failed_load = true;\n }\n }\n\n if (root._bokeh_is_loading === 0) {\n console.debug(\"Bokeh: BokehJS loaded, going straight to plotting\");\n run_inline_js();\n } else {\n load_libs(css_urls, js_urls, js_modules, function() {\n console.debug(\"Bokeh: BokehJS plotting callback run at\", now());\n run_inline_js();\n });\n }\n}(window));" }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/javascript": [ "\n", "if ((window.PyViz === undefined) || (window.PyViz instanceof HTMLElement)) {\n", " window.PyViz = {comms: {}, comm_status:{}, kernels:{}, receivers: {}, plot_index: []}\n", "}\n", "\n", "\n", " function JupyterCommManager() {\n", " }\n", "\n", " JupyterCommManager.prototype.register_target = function(plot_id, comm_id, msg_handler) {\n", " if (window.comm_manager || ((window.Jupyter !== undefined) && (Jupyter.notebook.kernel != null))) {\n", " var comm_manager = window.comm_manager || Jupyter.notebook.kernel.comm_manager;\n", " comm_manager.register_target(comm_id, function(comm) {\n", " comm.on_msg(msg_handler);\n", " });\n", " } else if ((plot_id in window.PyViz.kernels) && (window.PyViz.kernels[plot_id])) {\n", " window.PyViz.kernels[plot_id].registerCommTarget(comm_id, function(comm) {\n", " comm.onMsg = msg_handler;\n", " });\n", " } else if (typeof google != 'undefined' && google.colab.kernel != null) {\n", " google.colab.kernel.comms.registerTarget(comm_id, (comm) => {\n", " var messages = comm.messages[Symbol.asyncIterator]();\n", " function processIteratorResult(result) {\n", " var message = result.value;\n", " console.log(message)\n", " var content = {data: message.data, comm_id};\n", " var buffers = []\n", " for (var buffer of message.buffers || []) {\n", " buffers.push(new DataView(buffer))\n", " }\n", " var metadata = message.metadata || {};\n", " var msg = {content, buffers, metadata}\n", " msg_handler(msg);\n", " return messages.next().then(processIteratorResult);\n", " }\n", " return messages.next().then(processIteratorResult);\n", " })\n", " }\n", " }\n", "\n", " JupyterCommManager.prototype.get_client_comm = function(plot_id, comm_id, msg_handler) {\n", " if (comm_id in window.PyViz.comms) {\n", " return window.PyViz.comms[comm_id];\n", " } else if (window.comm_manager || ((window.Jupyter !== undefined) && (Jupyter.notebook.kernel != null))) {\n", " var comm_manager = window.comm_manager || Jupyter.notebook.kernel.comm_manager;\n", " var comm = comm_manager.new_comm(comm_id, {}, {}, {}, comm_id);\n", " if (msg_handler) {\n", " comm.on_msg(msg_handler);\n", " }\n", " } else if ((plot_id in window.PyViz.kernels) && (window.PyViz.kernels[plot_id])) {\n", " var comm = window.PyViz.kernels[plot_id].connectToComm(comm_id);\n", " comm.open();\n", " if (msg_handler) {\n", " comm.onMsg = msg_handler;\n", " }\n", " } else if (typeof google != 'undefined' && google.colab.kernel != null) {\n", " var comm_promise = google.colab.kernel.comms.open(comm_id)\n", " comm_promise.then((comm) => {\n", " window.PyViz.comms[comm_id] = comm;\n", " if (msg_handler) {\n", " var messages = comm.messages[Symbol.asyncIterator]();\n", " function processIteratorResult(result) {\n", " var message = result.value;\n", " var content = {data: message.data};\n", " var metadata = message.metadata || {comm_id};\n", " var msg = {content, metadata}\n", " msg_handler(msg);\n", " return messages.next().then(processIteratorResult);\n", " }\n", " return messages.next().then(processIteratorResult);\n", " }\n", " }) \n", " var sendClosure = (data, metadata, buffers, disposeOnDone) => {\n", " return comm_promise.then((comm) => {\n", " comm.send(data, metadata, buffers, disposeOnDone);\n", " });\n", " };\n", " var comm = {\n", " send: sendClosure\n", " };\n", " }\n", " window.PyViz.comms[comm_id] = comm;\n", " return comm;\n", " }\n", " window.PyViz.comm_manager = new JupyterCommManager();\n", " \n", "\n", "\n", "var JS_MIME_TYPE = 'application/javascript';\n", "var HTML_MIME_TYPE = 'text/html';\n", "var EXEC_MIME_TYPE = 'application/vnd.holoviews_exec.v0+json';\n", "var CLASS_NAME = 'output';\n", "\n", "/**\n", " * Render data to the DOM node\n", " */\n", "function render(props, node) {\n", " var div = document.createElement(\"div\");\n", " var script = document.createElement(\"script\");\n", " node.appendChild(div);\n", " node.appendChild(script);\n", "}\n", "\n", "/**\n", " * Handle when a new output is added\n", " */\n", "function handle_add_output(event, handle) {\n", " var output_area = handle.output_area;\n", " var output = handle.output;\n", " if ((output.data == undefined) || (!output.data.hasOwnProperty(EXEC_MIME_TYPE))) {\n", " return\n", " }\n", " var id = output.metadata[EXEC_MIME_TYPE][\"id\"];\n", " var toinsert = output_area.element.find(\".\" + CLASS_NAME.split(' ')[0]);\n", " if (id !== undefined) {\n", " var nchildren = toinsert.length;\n", " var html_node = toinsert[nchildren-1].children[0];\n", " html_node.innerHTML = output.data[HTML_MIME_TYPE];\n", " var scripts = [];\n", " var nodelist = html_node.querySelectorAll(\"script\");\n", " for (var i in nodelist) {\n", " if (nodelist.hasOwnProperty(i)) {\n", " scripts.push(nodelist[i])\n", " }\n", " }\n", "\n", " scripts.forEach( function (oldScript) {\n", " var newScript = document.createElement(\"script\");\n", " var attrs = [];\n", " var nodemap = oldScript.attributes;\n", " for (var j in nodemap) {\n", " if (nodemap.hasOwnProperty(j)) {\n", " attrs.push(nodemap[j])\n", " }\n", " }\n", " attrs.forEach(function(attr) { newScript.setAttribute(attr.name, attr.value) });\n", " newScript.appendChild(document.createTextNode(oldScript.innerHTML));\n", " oldScript.parentNode.replaceChild(newScript, oldScript);\n", " });\n", " if (JS_MIME_TYPE in output.data) {\n", " toinsert[nchildren-1].children[1].textContent = output.data[JS_MIME_TYPE];\n", " }\n", " output_area._hv_plot_id = id;\n", " if ((window.Bokeh !== undefined) && (id in Bokeh.index)) {\n", " window.PyViz.plot_index[id] = Bokeh.index[id];\n", " } else {\n", " window.PyViz.plot_index[id] = null;\n", " }\n", " } else if (output.metadata[EXEC_MIME_TYPE][\"server_id\"] !== undefined) {\n", " var bk_div = document.createElement(\"div\");\n", " bk_div.innerHTML = output.data[HTML_MIME_TYPE];\n", " var script_attrs = bk_div.children[0].attributes;\n", " for (var i = 0; i < script_attrs.length; i++) {\n", " toinsert[toinsert.length - 1].childNodes[1].setAttribute(script_attrs[i].name, script_attrs[i].value);\n", " }\n", " // store reference to server id on output_area\n", " output_area._bokeh_server_id = output.metadata[EXEC_MIME_TYPE][\"server_id\"];\n", " }\n", "}\n", "\n", "/**\n", " * Handle when an output is cleared or removed\n", " */\n", "function handle_clear_output(event, handle) {\n", " var id = handle.cell.output_area._hv_plot_id;\n", " var server_id = handle.cell.output_area._bokeh_server_id;\n", " if (((id === undefined) || !(id in PyViz.plot_index)) && (server_id !== undefined)) { return; }\n", " var comm = window.PyViz.comm_manager.get_client_comm(\"hv-extension-comm\", \"hv-extension-comm\", function () {});\n", " if (server_id !== null) {\n", " comm.send({event_type: 'server_delete', 'id': server_id});\n", " return;\n", " } else if (comm !== null) {\n", " comm.send({event_type: 'delete', 'id': id});\n", " }\n", " delete PyViz.plot_index[id];\n", " if ((window.Bokeh !== undefined) & (id in window.Bokeh.index)) {\n", " var doc = window.Bokeh.index[id].model.document\n", " doc.clear();\n", " const i = window.Bokeh.documents.indexOf(doc);\n", " if (i > -1) {\n", " window.Bokeh.documents.splice(i, 1);\n", " }\n", " }\n", "}\n", "\n", "/**\n", " * Handle kernel restart event\n", " */\n", "function handle_kernel_cleanup(event, handle) {\n", " delete PyViz.comms[\"hv-extension-comm\"];\n", " window.PyViz.plot_index = {}\n", "}\n", "\n", "/**\n", " * Handle update_display_data messages\n", " */\n", "function handle_update_output(event, handle) {\n", " handle_clear_output(event, {cell: {output_area: handle.output_area}})\n", " handle_add_output(event, handle)\n", "}\n", "\n", "function register_renderer(events, OutputArea) {\n", " function append_mime(data, metadata, element) {\n", " // create a DOM node to render to\n", " var toinsert = this.create_output_subarea(\n", " metadata,\n", " CLASS_NAME,\n", " EXEC_MIME_TYPE\n", " );\n", " this.keyboard_manager.register_events(toinsert);\n", " // Render to node\n", " var props = {data: data, metadata: metadata[EXEC_MIME_TYPE]};\n", " render(props, toinsert[0]);\n", " element.append(toinsert);\n", " return toinsert\n", " }\n", "\n", " events.on('output_added.OutputArea', handle_add_output);\n", " events.on('output_updated.OutputArea', handle_update_output);\n", " events.on('clear_output.CodeCell', handle_clear_output);\n", " events.on('delete.Cell', handle_clear_output);\n", " events.on('kernel_ready.Kernel', handle_kernel_cleanup);\n", "\n", " OutputArea.prototype.register_mime_type(EXEC_MIME_TYPE, append_mime, {\n", " safe: true,\n", " index: 0\n", " });\n", "}\n", "\n", "if (window.Jupyter !== undefined) {\n", " try {\n", " var events = require('base/js/events');\n", " var OutputArea = require('notebook/js/outputarea').OutputArea;\n", " if (OutputArea.prototype.mime_types().indexOf(EXEC_MIME_TYPE) == -1) {\n", " register_renderer(events, OutputArea);\n", " }\n", " } catch(err) {\n", " }\n", "}\n" ], "application/vnd.holoviews_load.v0+json": "\nif ((window.PyViz === undefined) || (window.PyViz instanceof HTMLElement)) {\n window.PyViz = {comms: {}, comm_status:{}, kernels:{}, receivers: {}, plot_index: []}\n}\n\n\n function JupyterCommManager() {\n }\n\n JupyterCommManager.prototype.register_target = function(plot_id, comm_id, msg_handler) {\n if (window.comm_manager || ((window.Jupyter !== undefined) && (Jupyter.notebook.kernel != null))) {\n var comm_manager = window.comm_manager || Jupyter.notebook.kernel.comm_manager;\n comm_manager.register_target(comm_id, function(comm) {\n comm.on_msg(msg_handler);\n });\n } else if ((plot_id in window.PyViz.kernels) && (window.PyViz.kernels[plot_id])) {\n window.PyViz.kernels[plot_id].registerCommTarget(comm_id, function(comm) {\n comm.onMsg = msg_handler;\n });\n } else if (typeof google != 'undefined' && google.colab.kernel != null) {\n google.colab.kernel.comms.registerTarget(comm_id, (comm) => {\n var messages = comm.messages[Symbol.asyncIterator]();\n function processIteratorResult(result) {\n var message = result.value;\n console.log(message)\n var content = {data: message.data, comm_id};\n var buffers = []\n for (var buffer of message.buffers || []) {\n buffers.push(new DataView(buffer))\n }\n var metadata = message.metadata || {};\n var msg = {content, buffers, metadata}\n msg_handler(msg);\n return messages.next().then(processIteratorResult);\n }\n return messages.next().then(processIteratorResult);\n })\n }\n }\n\n JupyterCommManager.prototype.get_client_comm = function(plot_id, comm_id, msg_handler) {\n if (comm_id in window.PyViz.comms) {\n return window.PyViz.comms[comm_id];\n } else if (window.comm_manager || ((window.Jupyter !== undefined) && (Jupyter.notebook.kernel != null))) {\n var comm_manager = window.comm_manager || Jupyter.notebook.kernel.comm_manager;\n var comm = comm_manager.new_comm(comm_id, {}, {}, {}, comm_id);\n if (msg_handler) {\n comm.on_msg(msg_handler);\n }\n } else if ((plot_id in window.PyViz.kernels) && (window.PyViz.kernels[plot_id])) {\n var comm = window.PyViz.kernels[plot_id].connectToComm(comm_id);\n comm.open();\n if (msg_handler) {\n comm.onMsg = msg_handler;\n }\n } else if (typeof google != 'undefined' && google.colab.kernel != null) {\n var comm_promise = google.colab.kernel.comms.open(comm_id)\n comm_promise.then((comm) => {\n window.PyViz.comms[comm_id] = comm;\n if (msg_handler) {\n var messages = comm.messages[Symbol.asyncIterator]();\n function processIteratorResult(result) {\n var message = result.value;\n var content = {data: message.data};\n var metadata = message.metadata || {comm_id};\n var msg = {content, metadata}\n msg_handler(msg);\n return messages.next().then(processIteratorResult);\n }\n return messages.next().then(processIteratorResult);\n }\n }) \n var sendClosure = (data, metadata, buffers, disposeOnDone) => {\n return comm_promise.then((comm) => {\n comm.send(data, metadata, buffers, disposeOnDone);\n });\n };\n var comm = {\n send: sendClosure\n };\n }\n window.PyViz.comms[comm_id] = comm;\n return comm;\n }\n window.PyViz.comm_manager = new JupyterCommManager();\n \n\n\nvar JS_MIME_TYPE = 'application/javascript';\nvar HTML_MIME_TYPE = 'text/html';\nvar EXEC_MIME_TYPE = 'application/vnd.holoviews_exec.v0+json';\nvar CLASS_NAME = 'output';\n\n/**\n * Render data to the DOM node\n */\nfunction render(props, node) {\n var div = document.createElement(\"div\");\n var script = document.createElement(\"script\");\n node.appendChild(div);\n node.appendChild(script);\n}\n\n/**\n * Handle when a new output is added\n */\nfunction handle_add_output(event, handle) {\n var output_area = handle.output_area;\n var output = handle.output;\n if ((output.data == undefined) || (!output.data.hasOwnProperty(EXEC_MIME_TYPE))) {\n return\n }\n var id = output.metadata[EXEC_MIME_TYPE][\"id\"];\n var toinsert = output_area.element.find(\".\" + CLASS_NAME.split(' ')[0]);\n if (id !== undefined) {\n var nchildren = toinsert.length;\n var html_node = toinsert[nchildren-1].children[0];\n html_node.innerHTML = output.data[HTML_MIME_TYPE];\n var scripts = [];\n var nodelist = html_node.querySelectorAll(\"script\");\n for (var i in nodelist) {\n if (nodelist.hasOwnProperty(i)) {\n scripts.push(nodelist[i])\n }\n }\n\n scripts.forEach( function (oldScript) {\n var newScript = document.createElement(\"script\");\n var attrs = [];\n var nodemap = oldScript.attributes;\n for (var j in nodemap) {\n if (nodemap.hasOwnProperty(j)) {\n attrs.push(nodemap[j])\n }\n }\n attrs.forEach(function(attr) { newScript.setAttribute(attr.name, attr.value) });\n newScript.appendChild(document.createTextNode(oldScript.innerHTML));\n oldScript.parentNode.replaceChild(newScript, oldScript);\n });\n if (JS_MIME_TYPE in output.data) {\n toinsert[nchildren-1].children[1].textContent = output.data[JS_MIME_TYPE];\n }\n output_area._hv_plot_id = id;\n if ((window.Bokeh !== undefined) && (id in Bokeh.index)) {\n window.PyViz.plot_index[id] = Bokeh.index[id];\n } else {\n window.PyViz.plot_index[id] = null;\n }\n } else if (output.metadata[EXEC_MIME_TYPE][\"server_id\"] !== undefined) {\n var bk_div = document.createElement(\"div\");\n bk_div.innerHTML = output.data[HTML_MIME_TYPE];\n var script_attrs = bk_div.children[0].attributes;\n for (var i = 0; i < script_attrs.length; i++) {\n toinsert[toinsert.length - 1].childNodes[1].setAttribute(script_attrs[i].name, script_attrs[i].value);\n }\n // store reference to server id on output_area\n output_area._bokeh_server_id = output.metadata[EXEC_MIME_TYPE][\"server_id\"];\n }\n}\n\n/**\n * Handle when an output is cleared or removed\n */\nfunction handle_clear_output(event, handle) {\n var id = handle.cell.output_area._hv_plot_id;\n var server_id = handle.cell.output_area._bokeh_server_id;\n if (((id === undefined) || !(id in PyViz.plot_index)) && (server_id !== undefined)) { return; }\n var comm = window.PyViz.comm_manager.get_client_comm(\"hv-extension-comm\", \"hv-extension-comm\", function () {});\n if (server_id !== null) {\n comm.send({event_type: 'server_delete', 'id': server_id});\n return;\n } else if (comm !== null) {\n comm.send({event_type: 'delete', 'id': id});\n }\n delete PyViz.plot_index[id];\n if ((window.Bokeh !== undefined) & (id in window.Bokeh.index)) {\n var doc = window.Bokeh.index[id].model.document\n doc.clear();\n const i = window.Bokeh.documents.indexOf(doc);\n if (i > -1) {\n window.Bokeh.documents.splice(i, 1);\n }\n }\n}\n\n/**\n * Handle kernel restart event\n */\nfunction handle_kernel_cleanup(event, handle) {\n delete PyViz.comms[\"hv-extension-comm\"];\n window.PyViz.plot_index = {}\n}\n\n/**\n * Handle update_display_data messages\n */\nfunction handle_update_output(event, handle) {\n handle_clear_output(event, {cell: {output_area: handle.output_area}})\n handle_add_output(event, handle)\n}\n\nfunction register_renderer(events, OutputArea) {\n function append_mime(data, metadata, element) {\n // create a DOM node to render to\n var toinsert = this.create_output_subarea(\n metadata,\n CLASS_NAME,\n EXEC_MIME_TYPE\n );\n this.keyboard_manager.register_events(toinsert);\n // Render to node\n var props = {data: data, metadata: metadata[EXEC_MIME_TYPE]};\n render(props, toinsert[0]);\n element.append(toinsert);\n return toinsert\n }\n\n events.on('output_added.OutputArea', handle_add_output);\n events.on('output_updated.OutputArea', handle_update_output);\n events.on('clear_output.CodeCell', handle_clear_output);\n events.on('delete.Cell', handle_clear_output);\n events.on('kernel_ready.Kernel', handle_kernel_cleanup);\n\n OutputArea.prototype.register_mime_type(EXEC_MIME_TYPE, append_mime, {\n safe: true,\n index: 0\n });\n}\n\nif (window.Jupyter !== undefined) {\n try {\n var events = require('base/js/events');\n var OutputArea = require('notebook/js/outputarea').OutputArea;\n if (OutputArea.prototype.mime_types().indexOf(EXEC_MIME_TYPE) == -1) {\n register_renderer(events, OutputArea);\n }\n } catch(err) {\n }\n}\n" }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stderr", "output_type": "stream", "text": [ "[INFO 07-10 13:14:07] ax.utils.notebook.plotting: Injecting Plotly library into cell. Do not overwrite or delete cell.\n" ] }, { "data": { "text/html": [ " \n", " " ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "import pathlib\n", "import os\n", "\n", "import numpy as np\n", "from ax.utils.notebook.plotting import init_notebook_plotting\n", "from ax.plot.trace import optimization_trace_single_method_plotly\n", "from ax.service.utils.report_utils import get_standard_plots, exp_to_df\n", "import boa\n", "from botorch.test_functions.synthetic import Cosine8\n", "\n", "init_notebook_plotting()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Loading the Scheduler from our JSON file" ] }, { "cell_type": "code", "execution_count": 2, "metadata": { "tags": [] }, "outputs": [], "source": [ "# setup stuff just because this gets reused from the latest run for the case of the docs\n", "try:\n", " run = list(pathlib.Path().resolve().glob(\"moo_run*\"))[-1]\n", "except IndexError:\n", " print(\"No run to load. Make sure you run optimization_run.ipynb first\")" ] }, { "cell_type": "code", "execution_count": 3, "metadata": { "collapsed": false, "jupyter": { "outputs_hidden": false } }, "outputs": [], "source": [ "# Filepath to the scheduler.json\n", "\n", "scheduler_fp = run / \"scheduler.json\"" ] }, { "cell_type": "code", "execution_count": 4, "metadata": { "collapsed": false, "jupyter": { "outputs_hidden": false } }, "outputs": [], "source": [ "scheduler = boa.scheduler_from_json_file(scheduler_fp)" ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "Scheduler(experiment=Experiment(moo_run), generation_strategy=GenerationStrategy(name='Sobol+MOO', steps=[Sobol for 5 trials, MOO for subsequent trials]), options=SchedulerOptions(max_pending_trials=10, trial_type=, batch_size=None, total_trials=None, tolerated_trial_failure_rate=0.5, min_failed_trials_for_failure_rate_check=5, log_filepath=None, logging_level=20, ttl_seconds_for_trials=None, init_seconds_between_polls=1, min_seconds_before_poll=1.0, seconds_between_polls_backoff_factor=1.5, timeout_hours=None, run_trials_in_batches=False, debug_log_run_metadata=False, early_stopping_strategy=None, global_stopping_strategy=None, suppress_storage_errors_after_retries=False))" ] }, "execution_count": 5, "metadata": {}, "output_type": "execute_result" } ], "source": [ "scheduler" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Show the Best Fitted Trial" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "`best_fitted_trials` uses the data to do a fitting from all trials and with the noise levels you provided (or if no noise levels was provided, it assumed an unknown level of noise and inferred the noise level from the trial runs)" ] }, { "cell_type": "code", "execution_count": 6, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "{14: {'params': {'x0': 0.06722595104412638, 'x1': 1.0},\n", " 'means': {'branin': -4.008813794628448, 'currin': -3.661387866974217},\n", " 'cov_matrix': {'branin': {'branin': 0.00026961947888266765, 'currin': 0.0},\n", " 'currin': {'branin': 0.0, 'currin': 5.207734737516479e-06}}},\n", " 15: {'params': {'x0': 0.03180193896164709, 'x1': 1.0},\n", " 'means': {'branin': -8.899884415590682, 'currin': -2.4505460576603784},\n", " 'cov_matrix': {'branin': {'branin': 7.153857098052441e-05, 'currin': 0.0},\n", " 'currin': {'branin': 0.0, 'currin': 1.109756616320468e-06}}},\n", " 16: {'params': {'x0': 0.11623283268391146, 'x1': 0.8282747946292564},\n", " 'means': {'branin': -0.4783224142995621, 'currin': -5.503003487046663},\n", " 'cov_matrix': {'branin': {'branin': 0.0002766559403868488, 'currin': 0.0},\n", " 'currin': {'branin': 0.0, 'currin': 5.402333652885504e-06}}},\n", " 17: {'params': {'x0': 0.015048417956364869, 'x1': 1.0},\n", " 'means': {'branin': -12.974571261800854, 'currin': -1.7929020223943914},\n", " 'cov_matrix': {'branin': {'branin': 9.15016516661886e-05, 'currin': 0.0},\n", " 'currin': {'branin': 0.0, 'currin': 1.4827281523925727e-06}}},\n", " 18: {'params': {'x0': 0.09103888011045247, 'x1': 0.9205178128625962},\n", " 'means': {'branin': -1.6400256383939364, 'currin': -4.567897371782157},\n", " 'cov_matrix': {'branin': {'branin': 0.00019990303934425875, 'currin': 0.0},\n", " 'currin': {'branin': 0.0, 'currin': 2.44586092439294e-06}}},\n", " 19: {'params': {'x0': 0.047142348285469204, 'x1': 1.0},\n", " 'means': {'branin': -6.134113780443643, 'currin': -3.0111854188929237},\n", " 'cov_matrix': {'branin': {'branin': 7.021550234069503e-05, 'currin': 0.0},\n", " 'currin': {'branin': 0.0, 'currin': 1.070264460145957e-06}}},\n", " 20: {'params': {'x0': 0.023106465771415844, 'x1': 1.0},\n", " 'means': {'branin': -10.882027122942315, 'currin': -2.113750140730393},\n", " 'cov_matrix': {'branin': {'branin': 8.794222842843026e-05, 'currin': 0.0},\n", " 'currin': {'branin': 0.0, 'currin': 1.2436488291367215e-06}}},\n", " 21: {'params': {'x0': 0.07751938884859294, 'x1': 0.9555795698999422},\n", " 'means': {'branin': -2.7345059089879165, 'currin': -4.092356913512811},\n", " 'cov_matrix': {'branin': {'branin': 0.0001420368472132874, 'currin': 0.0},\n", " 'currin': {'branin': 0.0, 'currin': 1.6803741903020638e-06}}},\n", " 22: {'params': {'x0': 0.007355481512615939, 'x1': 1.0},\n", " 'means': {'branin': -15.194799134606619, 'currin': -1.481222200274546},\n", " 'cov_matrix': {'branin': {'branin': 0.00010387572493482764, 'currin': 0.0},\n", " 'currin': {'branin': 0.0, 'currin': 1.5192996731335434e-06}}},\n", " 23: {'params': {'x0': 0.03908359193452967, 'x1': 1.0},\n", " 'means': {'branin': -7.467956392217744, 'currin': -2.7226915188837775},\n", " 'cov_matrix': {'branin': {'branin': 7.949184634582838e-05, 'currin': 0.0},\n", " 'currin': {'branin': 0.0, 'currin': 1.1103827007582894e-06}}},\n", " 24: {'params': {'x0': 0.056162120588825436, 'x1': 1.0},\n", " 'means': {'branin': -4.964043836698938, 'currin': -3.316056498837279},\n", " 'cov_matrix': {'branin': {'branin': 9.616257008160628e-05, 'currin': 0.0},\n", " 'currin': {'branin': 0.0, 'currin': 1.3049769196583604e-06}}},\n", " 25: {'params': {'x0': 0.10471571056236206, 'x1': 0.886549012428079},\n", " 'means': {'branin': -0.8958620958998953, 'currin': -5.01298323536945},\n", " 'cov_matrix': {'branin': {'branin': 0.0002594495228334465, 'currin': 0.0},\n", " 'currin': {'branin': 0.0, 'currin': 4.271963175808508e-06}}},\n", " 29: {'params': {'x0': 0.07091388609793212, 'x1': 0.9697664369522259},\n", " 'means': {'branin': -3.3520688221727184, 'currin': -3.8589878616716238},\n", " 'cov_matrix': {'branin': {'branin': 0.00010702221707033513, 'currin': 0.0},\n", " 'currin': {'branin': 0.0, 'currin': 1.6663139873422187e-06}}},\n", " 30: {'params': {'x0': 0.08370617296891533, 'x1': 0.9365945604264692},\n", " 'means': {'branin': -2.1679160997818165, 'currin': -4.323582967127799},\n", " 'cov_matrix': {'branin': {'branin': 0.0001122890101476591, 'currin': 0.0},\n", " 'currin': {'branin': 0.0, 'currin': 1.6175561436118911e-06}}},\n", " 31: {'params': {'x0': 0.027357843825467926, 'x1': 1.0},\n", " 'means': {'branin': -9.87656169120849, 'currin': -2.2798412417489686},\n", " 'cov_matrix': {'branin': {'branin': 7.467004346551617e-05, 'currin': 0.0},\n", " 'currin': {'branin': 0.0, 'currin': 1.1476709427738756e-06}}},\n", " 32: {'params': {'x0': 0.011151095456090072, 'x1': 1.0},\n", " 'means': {'branin': -14.0727853711678, 'currin': -1.6355234955973494},\n", " 'cov_matrix': {'branin': {'branin': 9.539561756226283e-05, 'currin': 0.0},\n", " 'currin': {'branin': 0.0, 'currin': 1.549531841025951e-06}}},\n", " 33: {'params': {'x0': 0.05145632374008478, 'x1': 1.0},\n", " 'means': {'branin': -5.5312835464596795, 'currin': -3.1594992568806837},\n", " 'cov_matrix': {'branin': {'branin': 7.24282182256757e-05, 'currin': 0.0},\n", " 'currin': {'branin': 0.0, 'currin': 1.1281248740957874e-06}}},\n", " 34: {'params': {'x0': 0.06107277738350422, 'x1': 0.9956949185623516},\n", " 'means': {'branin': -4.434381831842595, 'currin': -3.4849939092749254},\n", " 'cov_matrix': {'branin': {'branin': 9.149597453744773e-05, 'currin': 0.0},\n", " 'currin': {'branin': 0.0, 'currin': 1.2188334448569422e-06}}},\n", " 35: {'params': {'x0': 0.09648215343546504, 'x1': 0.8985448669959295},\n", " 'means': {'branin': -1.236898110732044, 'currin': -4.782023989492875},\n", " 'cov_matrix': {'branin': {'branin': 0.0002566247782236055, 'currin': 0.0},\n", " 'currin': {'branin': 0.0, 'currin': 3.5947771501164473e-06}}},\n", " 36: {'params': {'x0': 0.10958535915301539, 'x1': 0.8588446971129297},\n", " 'means': {'branin': -0.6236679488767614, 'currin': -5.232185110099541},\n", " 'cov_matrix': {'branin': {'branin': 0.0002682506054205734, 'currin': 0.0},\n", " 'currin': {'branin': 0.0, 'currin': 4.377727316819803e-06}}},\n", " 37: {'params': {'x0': 0.04299190549604983, 'x1': 1.0},\n", " 'means': {'branin': -6.7876467608070765, 'currin': -2.864388085191634},\n", " 'cov_matrix': {'branin': {'branin': 7.199432266672974e-05, 'currin': 0.0},\n", " 'currin': {'branin': 0.0, 'currin': 1.0810828404502534e-06}}},\n", " 38: {'params': {'x0': 0.06779941107944121, 'x1': 0.9774980693027313},\n", " 'means': {'branin': -3.6762568054266147, 'currin': -3.74336935529284},\n", " 'cov_matrix': {'branin': {'branin': 0.00012427656827485023, 'currin': 0.0},\n", " 'currin': {'branin': 0.0, 'currin': 1.8205683179225473e-06}}},\n", " 39: {'params': {'x0': 0.01900925253683429, 'x1': 1.0},\n", " 'means': {'branin': -11.915728902317792, 'currin': -1.9514814368607007},\n", " 'cov_matrix': {'branin': {'branin': 9.261443537808275e-05, 'currin': 0.0},\n", " 'currin': {'branin': 0.0, 'currin': 1.362083324709956e-06}}},\n", " 40: {'params': {'x0': 0.12174627149495364, 'x1': 0.8314499206704036},\n", " 'means': {'branin': -0.41771324753313976, 'currin': -5.585668331519944},\n", " 'cov_matrix': {'branin': {'branin': 0.00027980676471676117, 'currin': 0.0},\n", " 'currin': {'branin': 0.0, 'currin': 5.76043941065037e-06}}},\n", " 41: {'params': {'x0': 0.0036408837664809826, 'x1': 1.0},\n", " 'means': {'branin': -16.34069629316031, 'currin': -1.3294290439408587},\n", " 'cov_matrix': {'branin': {'branin': 0.00010239589350866794, 'currin': 0.0},\n", " 'currin': {'branin': 0.0, 'currin': 1.8200350653497145e-06}}},\n", " 42: {'params': {'x0': 0.0353615561485768, 'x1': 1.0},\n", " 'means': {'branin': -8.173445796156095, 'currin': -2.584837541426608},\n", " 'cov_matrix': {'branin': {'branin': 7.857331461501071e-05, 'currin': 0.0},\n", " 'currin': {'branin': 0.0, 'currin': 1.1153382721777385e-06}}},\n", " 43: {'params': {'x0': 0.07398984357302966, 'x1': 0.9612420668949202},\n", " 'means': {'branin': -3.038576041936979, 'currin': -3.974569340989012},\n", " 'cov_matrix': {'branin': {'branin': 0.00011194467069654376, 'currin': 0.0},\n", " 'currin': {'branin': 0.0, 'currin': 1.5842567803704265e-06}}},\n", " 44: {'params': {'x0': 0.08035235521777204, 'x1': 0.9446983365729427},\n", " 'means': {'branin': -2.447317770162181, 'currin': -4.206082527282536},\n", " 'cov_matrix': {'branin': {'branin': 0.00011946137171401089, 'currin': 0.0},\n", " 'currin': {'branin': 0.0, 'currin': 1.5983600036544294e-06}}},\n", " 45: {'params': {'x0': 0.029553275886536726, 'x1': 1.0},\n", " 'means': {'branin': -9.384480308767584, 'currin': -2.364570769380621},\n", " 'cov_matrix': {'branin': {'branin': 7.050762454624161e-05, 'currin': 0.0},\n", " 'currin': {'branin': 0.0, 'currin': 1.119735565474482e-06}}},\n", " 46: {'params': {'x0': 0.05375151648258906, 'x1': 1.0},\n", " 'means': {'branin': -5.242748873353875, 'currin': -3.236554981153109},\n", " 'cov_matrix': {'branin': {'branin': 7.801806825734007e-05, 'currin': 0.0},\n", " 'currin': {'branin': 0.0, 'currin': 1.195551209775119e-06}}},\n", " 47: {'params': {'x0': 0.0870427884724268, 'x1': 0.9270846572813902},\n", " 'means': {'branin': -1.8973540568263587, 'currin': -4.443807612572621},\n", " 'cov_matrix': {'branin': {'branin': 0.0001273161095498475, 'currin': 0.0},\n", " 'currin': {'branin': 0.0, 'currin': 1.8251808576896564e-06}}},\n", " 48: {'params': {'x0': 0.0633160748743348, 'x1': 0.9892348693501222},\n", " 'means': {'branin': -4.17198867955314, 'currin': -3.5728608047662105},\n", " 'cov_matrix': {'branin': {'branin': 0.00012541628693456592, 'currin': 0.0},\n", " 'currin': {'branin': 0.0, 'currin': 1.4732376917211808e-06}}},\n", " 49: {'params': {'x0': 0.04503165869846433, 'x1': 1.0},\n", " 'means': {'branin': -6.4575247119310895, 'currin': -2.937020736804852},\n", " 'cov_matrix': {'branin': {'branin': 6.977361548964034e-05, 'currin': 0.0},\n", " 'currin': {'branin': 0.0, 'currin': 1.0694046943436186e-06}}},\n", " 8: {'params': {'x0': 0.0, 'x1': 1.0},\n", " 'means': {'branin': -17.506304079417717, 'currin': -1.180050578290825},\n", " 'cov_matrix': {'branin': {'branin': 0.00023219490141979877, 'currin': 0.0},\n", " 'currin': {'branin': 0.0, 'currin': 4.246944038315128e-06}}}}" ] }, "execution_count": 6, "metadata": {}, "output_type": "execute_result" } ], "source": [ "trial = scheduler.best_fitted_trials()\n", "trial" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Show the Best Raw Trial" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "if you need the exact points of the best trial, maybe because you need the trial number of the best trial to plot results, or for any other reason, `best_raw_trails` does not do any fitting" ] }, { "cell_type": "code", "execution_count": 7, "metadata": { "collapsed": false, "jupyter": { "outputs_hidden": false } }, "outputs": [ { "data": { "text/plain": [ "{14: {'params': {'x0': 0.06722595104412638, 'x1': 1.0},\n", " 'means': {'branin': -4.0096569061, 'currin': -3.661427021},\n", " 'cov_matrix': {'branin': {'branin': 0.0, 'currin': 0.0},\n", " 'currin': {'branin': 0.0, 'currin': 0.0}}},\n", " 15: {'params': {'x0': 0.03180193896164709, 'x1': 1.0},\n", " 'means': {'branin': -8.8998212814, 'currin': -2.4505946636},\n", " 'cov_matrix': {'branin': {'branin': 0.0, 'currin': 0.0},\n", " 'currin': {'branin': 0.0, 'currin': 0.0}}},\n", " 16: {'params': {'x0': 0.11623283268391146, 'x1': 0.8282747946292564},\n", " 'means': {'branin': -0.4777936935, 'currin': -5.5031733513},\n", " 'cov_matrix': {'branin': {'branin': 0.0, 'currin': 0.0},\n", " 'currin': {'branin': 0.0, 'currin': 0.0}}},\n", " 17: {'params': {'x0': 0.015048417956364869, 'x1': 1.0},\n", " 'means': {'branin': -12.9749555588, 'currin': -1.7927970886},\n", " 'cov_matrix': {'branin': {'branin': 0.0, 'currin': 0.0},\n", " 'currin': {'branin': 0.0, 'currin': 0.0}}},\n", " 18: {'params': {'x0': 0.09103888011045247, 'x1': 0.9205178128625962},\n", " 'means': {'branin': -1.6410369873, 'currin': -4.5677266121},\n", " 'cov_matrix': {'branin': {'branin': 0.0, 'currin': 0.0},\n", " 'currin': {'branin': 0.0, 'currin': 0.0}}},\n", " 19: {'params': {'x0': 0.047142348285469204, 'x1': 1.0},\n", " 'means': {'branin': -6.1341824532, 'currin': -3.0111839771},\n", " 'cov_matrix': {'branin': {'branin': 0.0, 'currin': 0.0},\n", " 'currin': {'branin': 0.0, 'currin': 0.0}}},\n", " 20: {'params': {'x0': 0.023106465771415844, 'x1': 1.0},\n", " 'means': {'branin': -10.8823547363, 'currin': -2.1138005257},\n", " 'cov_matrix': {'branin': {'branin': 0.0, 'currin': 0.0},\n", " 'currin': {'branin': 0.0, 'currin': 0.0}}},\n", " 21: {'params': {'x0': 0.07751938884859294, 'x1': 0.9555795698999422},\n", " 'means': {'branin': -2.7341222763, 'currin': -4.092294693},\n", " 'cov_matrix': {'branin': {'branin': 0.0, 'currin': 0.0},\n", " 'currin': {'branin': 0.0, 'currin': 0.0}}},\n", " 22: {'params': {'x0': 0.007355481512615939, 'x1': 1.0},\n", " 'means': {'branin': -15.1932506561, 'currin': -1.4809924364},\n", " 'cov_matrix': {'branin': {'branin': 0.0, 'currin': 0.0},\n", " 'currin': {'branin': 0.0, 'currin': 0.0}}},\n", " 23: {'params': {'x0': 0.03908359193452967, 'x1': 1.0},\n", " 'means': {'branin': -7.4678997993, 'currin': -2.7226967812},\n", " 'cov_matrix': {'branin': {'branin': 0.0, 'currin': 0.0},\n", " 'currin': {'branin': 0.0, 'currin': 0.0}}},\n", " 24: {'params': {'x0': 0.056162120588825436, 'x1': 1.0},\n", " 'means': {'branin': -4.9641985893000005, 'currin': -3.3161087036},\n", " 'cov_matrix': {'branin': {'branin': 0.0, 'currin': 0.0},\n", " 'currin': {'branin': 0.0, 'currin': 0.0}}},\n", " 25: {'params': {'x0': 0.10471571056236206, 'x1': 0.886549012428079},\n", " 'means': {'branin': -0.8956365585, 'currin': -5.0127587318},\n", " 'cov_matrix': {'branin': {'branin': 0.0, 'currin': 0.0},\n", " 'currin': {'branin': 0.0, 'currin': 0.0}}},\n", " 29: {'params': {'x0': 0.07091388609793212, 'x1': 0.9697664369522259},\n", " 'means': {'branin': -3.3521566391, 'currin': -3.8589537144},\n", " 'cov_matrix': {'branin': {'branin': 0.0, 'currin': 0.0},\n", " 'currin': {'branin': 0.0, 'currin': 0.0}}},\n", " 30: {'params': {'x0': 0.08370617296891533, 'x1': 0.9365945604264692},\n", " 'means': {'branin': -2.167757988, 'currin': -4.3236260414},\n", " 'cov_matrix': {'branin': {'branin': 0.0, 'currin': 0.0},\n", " 'currin': {'branin': 0.0, 'currin': 0.0}}},\n", " 31: {'params': {'x0': 0.027357843825467926, 'x1': 1.0},\n", " 'means': {'branin': -9.8766317368, 'currin': -2.2799072266000002},\n", " 'cov_matrix': {'branin': {'branin': 0.0, 'currin': 0.0},\n", " 'currin': {'branin': 0.0, 'currin': 0.0}}},\n", " 32: {'params': {'x0': 0.011151095456090072, 'x1': 1.0},\n", " 'means': {'branin': -14.0723619461, 'currin': -1.6353210211},\n", " 'cov_matrix': {'branin': {'branin': 0.0, 'currin': 0.0},\n", " 'currin': {'branin': 0.0, 'currin': 0.0}}},\n", " 33: {'params': {'x0': 0.05145632374008478, 'x1': 1.0},\n", " 'means': {'branin': -5.5314288139, 'currin': -3.1595189571},\n", " 'cov_matrix': {'branin': {'branin': 0.0, 'currin': 0.0},\n", " 'currin': {'branin': 0.0, 'currin': 0.0}}},\n", " 34: {'params': {'x0': 0.06107277738350422, 'x1': 0.9956949185623516},\n", " 'means': {'branin': -4.4337778091, 'currin': -3.4849951267},\n", " 'cov_matrix': {'branin': {'branin': 0.0, 'currin': 0.0},\n", " 'currin': {'branin': 0.0, 'currin': 0.0}}},\n", " 35: {'params': {'x0': 0.09648215343546504, 'x1': 0.8985448669959295},\n", " 'means': {'branin': -1.2355241776, 'currin': -4.7820410728},\n", " 'cov_matrix': {'branin': {'branin': 0.0, 'currin': 0.0},\n", " 'currin': {'branin': 0.0, 'currin': 0.0}}},\n", " 36: {'params': {'x0': 0.10958535915301539, 'x1': 0.8588446971129297},\n", " 'means': {'branin': -0.6255817413, 'currin': -5.2327837944},\n", " 'cov_matrix': {'branin': {'branin': 0.0, 'currin': 0.0},\n", " 'currin': {'branin': 0.0, 'currin': 0.0}}},\n", " 37: {'params': {'x0': 0.04299190549604983, 'x1': 1.0},\n", " 'means': {'branin': -6.78764534, 'currin': -2.864382267},\n", " 'cov_matrix': {'branin': {'branin': 0.0, 'currin': 0.0},\n", " 'currin': {'branin': 0.0, 'currin': 0.0}}},\n", " 38: {'params': {'x0': 0.06779941107944121, 'x1': 0.9774980693027313},\n", " 'means': {'branin': -3.6760921478, 'currin': -3.7433075905},\n", " 'cov_matrix': {'branin': {'branin': 0.0, 'currin': 0.0},\n", " 'currin': {'branin': 0.0, 'currin': 0.0}}},\n", " 39: {'params': {'x0': 0.01900925253683429, 'x1': 1.0},\n", " 'means': {'branin': -11.9162807465, 'currin': -1.9514724016},\n", " 'cov_matrix': {'branin': {'branin': 0.0, 'currin': 0.0},\n", " 'currin': {'branin': 0.0, 'currin': 0.0}}},\n", " 40: {'params': {'x0': 0.12174627149495364, 'x1': 0.8314499206704036},\n", " 'means': {'branin': -0.4170780182, 'currin': -5.5851817131},\n", " 'cov_matrix': {'branin': {'branin': 0.0, 'currin': 0.0},\n", " 'currin': {'branin': 0.0, 'currin': 0.0}}},\n", " 41: {'params': {'x0': 0.0036408837664809826, 'x1': 1.0},\n", " 'means': {'branin': -16.3390979767, 'currin': -1.3293443918},\n", " 'cov_matrix': {'branin': {'branin': 0.0, 'currin': 0.0},\n", " 'currin': {'branin': 0.0, 'currin': 0.0}}},\n", " 42: {'params': {'x0': 0.0353615561485768, 'x1': 1.0},\n", " 'means': {'branin': -8.1733665466, 'currin': -2.5848639011},\n", " 'cov_matrix': {'branin': {'branin': 0.0, 'currin': 0.0},\n", " 'currin': {'branin': 0.0, 'currin': 0.0}}},\n", " 43: {'params': {'x0': 0.07398984357302966, 'x1': 0.9612420668949202},\n", " 'means': {'branin': -3.0389556885, 'currin': -3.9745893478},\n", " 'cov_matrix': {'branin': {'branin': 0.0, 'currin': 0.0},\n", " 'currin': {'branin': 0.0, 'currin': 0.0}}},\n", " 44: {'params': {'x0': 0.08035235521777204, 'x1': 0.9446983365729427},\n", " 'means': {'branin': -2.4474034309, 'currin': -4.2061553001},\n", " 'cov_matrix': {'branin': {'branin': 0.0, 'currin': 0.0},\n", " 'currin': {'branin': 0.0, 'currin': 0.0}}},\n", " 45: {'params': {'x0': 0.029553275886536726, 'x1': 1.0},\n", " 'means': {'branin': -9.3844604492, 'currin': -2.3646306992},\n", " 'cov_matrix': {'branin': {'branin': 0.0, 'currin': 0.0},\n", " 'currin': {'branin': 0.0, 'currin': 0.0}}},\n", " 46: {'params': {'x0': 0.05375151648258906, 'x1': 1.0},\n", " 'means': {'branin': -5.2429170609, 'currin': -3.236590147},\n", " 'cov_matrix': {'branin': {'branin': 0.0, 'currin': 0.0},\n", " 'currin': {'branin': 0.0, 'currin': 0.0}}},\n", " 47: {'params': {'x0': 0.0870427884724268, 'x1': 0.9270846572813902},\n", " 'means': {'branin': -1.8972387314, 'currin': -4.443857193},\n", " 'cov_matrix': {'branin': {'branin': 0.0, 'currin': 0.0},\n", " 'currin': {'branin': 0.0, 'currin': 0.0}}},\n", " 48: {'params': {'x0': 0.0633160748743348, 'x1': 0.9892348693501222},\n", " 'means': {'branin': -4.1712288857, 'currin': -3.5728039742},\n", " 'cov_matrix': {'branin': {'branin': 0.0, 'currin': 0.0},\n", " 'currin': {'branin': 0.0, 'currin': 0.0}}},\n", " 49: {'params': {'x0': 0.04503165869846433, 'x1': 1.0},\n", " 'means': {'branin': -6.4575519562, 'currin': -2.9370145798},\n", " 'cov_matrix': {'branin': {'branin': 0.0, 'currin': 0.0},\n", " 'currin': {'branin': 0.0, 'currin': 0.0}}},\n", " 8: {'params': {'x0': 0.0, 'x1': 1.0},\n", " 'means': {'branin': -17.5082969666, 'currin': -1.1804080009},\n", " 'cov_matrix': {'branin': {'branin': 0.0, 'currin': 0.0},\n", " 'currin': {'branin': 0.0, 'currin': 0.0}}}}" ] }, "execution_count": 7, "metadata": {}, "output_type": "execute_result" } ], "source": [ "trial = scheduler.best_raw_trials()\n", "trial" ] }, { "cell_type": "code", "execution_count": 8, "metadata": { "collapsed": false, "jupyter": { "outputs_hidden": false } }, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
trial_indexarm_nametrial_statusgeneration_methodbranincurrinis_feasiblex0x1
000_0COMPLETEDSobol-104.829926-13.321523False0.1571860.063027
111_0COMPLETEDSobol-67.450264-6.262702False0.7955100.548820
222_0COMPLETEDSobol-44.699284-11.003670False0.1629040.291876
333_0COMPLETEDSobol-10.633623-8.563358False0.8958870.280258
444_0COMPLETEDSobol-2.309752-10.189129False0.5113770.240122
555_0COMPLETEDMOO-191.902283-4.252816False0.7976500.959299
666_0COMPLETEDMOO-31.095140-5.988050False0.2345060.876196
777_0COMPLETEDMOO-121.471985-4.946413False0.3896111.000000
888_0COMPLETEDMOO-17.508297-1.180408True0.0000001.000000
999_0COMPLETEDMOO-52.435886-6.313510False0.3987860.710204
101010_0COMPLETEDMOO-68.184647-5.815774False0.4820070.739821
111111_0COMPLETEDMOO-27.527704-1.290188False0.0000000.889318
121212_0COMPLETEDMOO-21.664143-1.231126False0.0000000.946487
131313_0COMPLETEDMOO-36.937912-1.372257False0.0000000.817771
141414_0COMPLETEDMOO-4.009657-3.661427True0.0672261.000000
151515_0COMPLETEDMOO-8.899821-2.450595True0.0318021.000000
161616_0COMPLETEDMOO-0.477794-5.503173True0.1162330.828275
171717_0COMPLETEDMOO-12.974956-1.792797True0.0150481.000000
181818_0COMPLETEDMOO-1.641037-4.567727True0.0910390.920518
191919_0COMPLETEDMOO-6.134182-3.011184True0.0471421.000000
202020_0COMPLETEDMOO-10.882355-2.113801True0.0231061.000000
212121_0COMPLETEDMOO-2.734122-4.092295True0.0775190.955580
222222_0COMPLETEDMOO-15.193251-1.480992True0.0073551.000000
232323_0COMPLETEDMOO-7.467900-2.722697True0.0390841.000000
242424_0COMPLETEDMOO-4.964199-3.316109True0.0561621.000000
252525_0COMPLETEDMOO-0.895637-5.012759True0.1047160.886549
262626_0COMPLETEDMOO-34.853767-5.863936False1.0000000.582649
272727_0COMPLETEDMOO-145.872208-4.005316False1.0000001.000000
282828_0COMPLETEDMOO-10.960894-10.179487False1.0000000.000000
292929_0COMPLETEDMOO-3.352157-3.858954True0.0709140.969766
303030_0COMPLETEDMOO-2.167758-4.323626True0.0837060.936595
313131_0COMPLETEDMOO-9.876632-2.279907True0.0273581.000000
323232_0COMPLETEDMOO-14.072362-1.635321True0.0111511.000000
333333_0COMPLETEDMOO-5.531429-3.159519True0.0514561.000000
343434_0COMPLETEDMOO-4.433778-3.484995True0.0610730.995695
353535_0COMPLETEDMOO-1.235524-4.782041True0.0964820.898545
363636_0COMPLETEDMOO-0.625582-5.232784True0.1095850.858845
373737_0COMPLETEDMOO-6.787645-2.864382True0.0429921.000000
383838_0COMPLETEDMOO-3.676092-3.743308True0.0677990.977498
393939_0COMPLETEDMOO-11.916281-1.951472True0.0190091.000000
404040_0COMPLETEDMOO-0.417078-5.585182True0.1217460.831450
414141_0COMPLETEDMOO-16.339098-1.329344True0.0036411.000000
424242_0COMPLETEDMOO-8.173367-2.584864True0.0353621.000000
434343_0COMPLETEDMOO-3.038956-3.974589True0.0739900.961242
444444_0COMPLETEDMOO-2.447403-4.206155True0.0803520.944698
454545_0COMPLETEDMOO-9.384460-2.364631True0.0295531.000000
464646_0COMPLETEDMOO-5.242917-3.236590True0.0537521.000000
474747_0COMPLETEDMOO-1.897239-4.443857True0.0870430.927085
484848_0COMPLETEDMOO-4.171229-3.572804True0.0633160.989235
494949_0COMPLETEDMOO-6.457552-2.937015True0.0450321.000000
\n", "
" ], "text/plain": [ " trial_index arm_name trial_status generation_method branin \\\n", "0 0 0_0 COMPLETED Sobol -104.829926 \n", "1 1 1_0 COMPLETED Sobol -67.450264 \n", "2 2 2_0 COMPLETED Sobol -44.699284 \n", "3 3 3_0 COMPLETED Sobol -10.633623 \n", "4 4 4_0 COMPLETED Sobol -2.309752 \n", "5 5 5_0 COMPLETED MOO -191.902283 \n", "6 6 6_0 COMPLETED MOO -31.095140 \n", "7 7 7_0 COMPLETED MOO -121.471985 \n", "8 8 8_0 COMPLETED MOO -17.508297 \n", "9 9 9_0 COMPLETED MOO -52.435886 \n", "10 10 10_0 COMPLETED MOO -68.184647 \n", "11 11 11_0 COMPLETED MOO -27.527704 \n", "12 12 12_0 COMPLETED MOO -21.664143 \n", "13 13 13_0 COMPLETED MOO -36.937912 \n", "14 14 14_0 COMPLETED MOO -4.009657 \n", "15 15 15_0 COMPLETED MOO -8.899821 \n", "16 16 16_0 COMPLETED MOO -0.477794 \n", "17 17 17_0 COMPLETED MOO -12.974956 \n", "18 18 18_0 COMPLETED MOO -1.641037 \n", "19 19 19_0 COMPLETED MOO -6.134182 \n", "20 20 20_0 COMPLETED MOO -10.882355 \n", "21 21 21_0 COMPLETED MOO -2.734122 \n", "22 22 22_0 COMPLETED MOO -15.193251 \n", "23 23 23_0 COMPLETED MOO -7.467900 \n", "24 24 24_0 COMPLETED MOO -4.964199 \n", "25 25 25_0 COMPLETED MOO -0.895637 \n", "26 26 26_0 COMPLETED MOO -34.853767 \n", "27 27 27_0 COMPLETED MOO -145.872208 \n", "28 28 28_0 COMPLETED MOO -10.960894 \n", "29 29 29_0 COMPLETED MOO -3.352157 \n", "30 30 30_0 COMPLETED MOO -2.167758 \n", "31 31 31_0 COMPLETED MOO -9.876632 \n", "32 32 32_0 COMPLETED MOO -14.072362 \n", "33 33 33_0 COMPLETED MOO -5.531429 \n", "34 34 34_0 COMPLETED MOO -4.433778 \n", "35 35 35_0 COMPLETED MOO -1.235524 \n", "36 36 36_0 COMPLETED MOO -0.625582 \n", "37 37 37_0 COMPLETED MOO -6.787645 \n", "38 38 38_0 COMPLETED MOO -3.676092 \n", "39 39 39_0 COMPLETED MOO -11.916281 \n", "40 40 40_0 COMPLETED MOO -0.417078 \n", "41 41 41_0 COMPLETED MOO -16.339098 \n", "42 42 42_0 COMPLETED MOO -8.173367 \n", "43 43 43_0 COMPLETED MOO -3.038956 \n", "44 44 44_0 COMPLETED MOO -2.447403 \n", "45 45 45_0 COMPLETED MOO -9.384460 \n", "46 46 46_0 COMPLETED MOO -5.242917 \n", "47 47 47_0 COMPLETED MOO -1.897239 \n", "48 48 48_0 COMPLETED MOO -4.171229 \n", "49 49 49_0 COMPLETED MOO -6.457552 \n", "\n", " currin is_feasible x0 x1 \n", "0 -13.321523 False 0.157186 0.063027 \n", "1 -6.262702 False 0.795510 0.548820 \n", "2 -11.003670 False 0.162904 0.291876 \n", "3 -8.563358 False 0.895887 0.280258 \n", "4 -10.189129 False 0.511377 0.240122 \n", "5 -4.252816 False 0.797650 0.959299 \n", "6 -5.988050 False 0.234506 0.876196 \n", "7 -4.946413 False 0.389611 1.000000 \n", "8 -1.180408 True 0.000000 1.000000 \n", "9 -6.313510 False 0.398786 0.710204 \n", "10 -5.815774 False 0.482007 0.739821 \n", "11 -1.290188 False 0.000000 0.889318 \n", "12 -1.231126 False 0.000000 0.946487 \n", "13 -1.372257 False 0.000000 0.817771 \n", "14 -3.661427 True 0.067226 1.000000 \n", "15 -2.450595 True 0.031802 1.000000 \n", "16 -5.503173 True 0.116233 0.828275 \n", "17 -1.792797 True 0.015048 1.000000 \n", "18 -4.567727 True 0.091039 0.920518 \n", "19 -3.011184 True 0.047142 1.000000 \n", "20 -2.113801 True 0.023106 1.000000 \n", "21 -4.092295 True 0.077519 0.955580 \n", "22 -1.480992 True 0.007355 1.000000 \n", "23 -2.722697 True 0.039084 1.000000 \n", "24 -3.316109 True 0.056162 1.000000 \n", "25 -5.012759 True 0.104716 0.886549 \n", "26 -5.863936 False 1.000000 0.582649 \n", "27 -4.005316 False 1.000000 1.000000 \n", "28 -10.179487 False 1.000000 0.000000 \n", "29 -3.858954 True 0.070914 0.969766 \n", "30 -4.323626 True 0.083706 0.936595 \n", "31 -2.279907 True 0.027358 1.000000 \n", "32 -1.635321 True 0.011151 1.000000 \n", "33 -3.159519 True 0.051456 1.000000 \n", "34 -3.484995 True 0.061073 0.995695 \n", "35 -4.782041 True 0.096482 0.898545 \n", "36 -5.232784 True 0.109585 0.858845 \n", "37 -2.864382 True 0.042992 1.000000 \n", "38 -3.743308 True 0.067799 0.977498 \n", "39 -1.951472 True 0.019009 1.000000 \n", "40 -5.585182 True 0.121746 0.831450 \n", "41 -1.329344 True 0.003641 1.000000 \n", "42 -2.584864 True 0.035362 1.000000 \n", "43 -3.974589 True 0.073990 0.961242 \n", "44 -4.206155 True 0.080352 0.944698 \n", "45 -2.364631 True 0.029553 1.000000 \n", "46 -3.236590 True 0.053752 1.000000 \n", "47 -4.443857 True 0.087043 0.927085 \n", "48 -3.572804 True 0.063316 0.989235 \n", "49 -2.937015 True 0.045032 1.000000 " ] }, "execution_count": 8, "metadata": {}, "output_type": "execute_result" } ], "source": [ "boa.scheduler_to_df(scheduler)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## EDA Plots with Pareto" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Because we ran a multi objective optimization, we can plot our pareto frontiers." ] }, { "cell_type": "code", "execution_count": 9, "metadata": { "tags": [] }, "outputs": [ { "data": {}, "metadata": {}, "output_type": "display_data" }, { "data": { "application/vnd.holoviews_exec.v0+json": "", "text/html": [ "
\n", "
\n", "
\n", "" ], "text/plain": [ "Plotly(Figure)" ] }, "execution_count": 9, "metadata": { "application/vnd.holoviews_exec.v0+json": { "id": "1003" } }, "output_type": "execute_result" } ], "source": [ "boa.plot_pareto_frontier(scheduler)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The rest of our plots are the same as for a single objective optimization. Trace plots, contour plots, and slice plots." ] }, { "cell_type": "code", "execution_count": 10, "metadata": {}, "outputs": [ { "data": {}, "metadata": {}, "output_type": "display_data" }, { "data": { "application/vnd.holoviews_exec.v0+json": "", "text/html": [ "
\n", "
\n", "
\n", "" ], "text/plain": [ "Column(sizing_mode='stretch_width')\n", " [0] Markdown(str)\n", " [1] Row\n", " [0] Select(name='Metric Name', options=['branin', 'currin'], value='branin')\n", " [2] ParamFunction(function, _pane=Plotly)" ] }, "execution_count": 10, "metadata": { "application/vnd.holoviews_exec.v0+json": { "id": "1024" } }, "output_type": "execute_result" } ], "source": [ "boa.plot_metrics_trace(scheduler)" ] }, { "cell_type": "code", "execution_count": 11, "metadata": {}, "outputs": [ { "data": {}, "metadata": {}, "output_type": "display_data" }, { "data": { "application/vnd.holoviews_exec.v0+json": "", "text/html": [ "
\n", "
\n", "
\n", "" ], "text/plain": [ "Column\n", " [0] Markdown(str)\n", " [1] Row\n", " [0] Select(name='Metric Name', options=['branin', 'currin'], value='branin')\n", " [1] Select(name='Param X', options=['x0'], value='x0')\n", " [2] Select(name='Param Y', options=['x1'], value='x1')\n", " [2] Plotly(Figure)" ] }, "execution_count": 11, "metadata": { "application/vnd.holoviews_exec.v0+json": { "id": "1116" } }, "output_type": "execute_result" } ], "source": [ "boa.plot_contours(scheduler)" ] }, { "cell_type": "code", "execution_count": 12, "metadata": {}, "outputs": [ { "data": {}, "metadata": {}, "output_type": "display_data" }, { "data": { "application/vnd.holoviews_exec.v0+json": "", "text/html": [ "
\n", "
\n", "
\n", "" ], "text/plain": [ "Plotly(Figure)" ] }, "execution_count": 12, "metadata": { "application/vnd.holoviews_exec.v0+json": { "id": "1198" } }, "output_type": "execute_result" } ], "source": [ "boa.plot_slice(scheduler)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "We can also directly pass in our scheduler file path instead of having to reload it ourselves" ] }, { "cell_type": "code", "execution_count": 13, "metadata": { "tags": [] }, "outputs": [ { "data": {}, "metadata": {}, "output_type": "display_data" }, { "data": { "application/vnd.holoviews_exec.v0+json": "", "text/html": [ "
\n", "
\n", "
\n", "" ], "text/plain": [ "Column(sizing_mode='stretch_width')\n", " [0] Markdown(str)\n", " [1] Row\n", " [0] Select(name='Metric Name', options=['branin', 'currin'], value='branin')\n", " [2] ParamFunction(function, _pane=Plotly)" ] }, "execution_count": 13, "metadata": { "application/vnd.holoviews_exec.v0+json": { "id": "1392" } }, "output_type": "execute_result" } ], "source": [ "boa.plot_metrics_trace(scheduler_fp)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Python [conda env:boa-dev]", "language": "python", "name": "conda-env-boa-dev-py" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.10.12" }, "vscode": { "interpreter": { "hash": "e4753ff389e29e439da2b5f976c0c752a36b29db5d37953ba5fa1bffb26df317" } } }, "nbformat": 4, "nbformat_minor": 4 }