.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_examples/04_validation/plot_06_reports.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code or to run this example in your browser via Binder. .. rst-class:: sphx-glr-example-title .. _sphx_glr_auto_examples_04_validation_plot_06_reports.py: Reports, animations and the burden of a session =============================================== A finished session can be written to a self-contained HTML report (settings, summary, galleries, curves, genealogy, map, evaluator diagnostics) and to an animated GIF of its galleries. Burden measures — images shown, elementary decisions, the information-theoretic upper bound of what the answers could convey, human answers, API cost — make sessions with different protocols comparable. .. GENERATED FROM PYTHON SOURCE LINES 14-16 A report and an animation ------------------------- .. GENERATED FROM PYTHON SOURCE LINES 16-31 .. code-block:: Python import matplotlib.pyplot as plt import easyiec as ei from easyiec.problems import CPPNArt from easyiec.strategies import InteractiveCMAES, InteractiveGA, PreferentialBO, SequentialGallery from easyiec.validation import burden problem = CPPNArt() user = ei.SimulatedUser(problem, target="random", noise=0.04, seed=2) result = ei.run(problem, InteractiveGA(pop_size=9), user, generations=10, seed=2) ei.viz.session_report(result, "cppn_report.html", evaluator=user, title="CPPN art with a simulated user") ei.viz.animate_session(result.log, problem, "cppn_session.gif", max_items=9, tile=96) print(burden(result.log)) ei.viz.plot_history(result.log, problem, steps=[0, 3, 6, 9], size=0.9) .. image-sg:: /auto_examples/04_validation/images/sphx_glr_plot_06_reports_001.png :alt: plot 06 reports :srcset: /auto_examples/04_validation/images/sphx_glr_plot_06_reports_001.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out .. code-block:: none {'queries': 10, 'items': 90, 'decisions': 90, 'bits': 90.0, 'human_answers': 0, 'tokens_in': 0, 'tokens_out': 0, 'usd': 0.0}
.. GENERATED FROM PYTHON SOURCE LINES 32-36 Burden of four protocols ------------------------ The same 150-image budget spent through galleries (GA, CMA-ES), single duels (PBO) and 3×3 grids (sequential gallery) on the same problem. .. GENERATED FROM PYTHON SOURCE LINES 36-52 .. code-block:: Python from easyiec.problems import SyntheticPreference # noqa: E402 p = SyntheticPreference(dim=4, seed=1) rows = [] for name, strat in {"GA (select)": InteractiveGA(), "CMA-ES (rank)": InteractiveCMAES(protocol="rank"), "PBO (pairs)": PreferentialBO(), "gallery (grid)": SequentialGallery()}.items(): res = ei.run(p, strat, ei.SimulatedUser(p, seed=3), budget=ei.Budget(max_items=150), seed=3) b = burden(res.log) rows.append((name, b["queries"], b["decisions"], b["bits"], res.best_true)) fig, axes = plt.subplots(1, 3, figsize=(12, 3)) for ax, k, lab in zip(axes, [1, 2, 3], ["questions asked", "elementary decisions", "information bound (bits)"]): ax.bar([r[0] for r in rows], [r[k] for r in rows], color="#285780") ax.set_title(lab, fontsize=9) ax.tick_params(axis="x", labelsize=7, rotation=20) fig.tight_layout() plt.show() .. image-sg:: /auto_examples/04_validation/images/sphx_glr_plot_06_reports_002.png :alt: questions asked, elementary decisions, information bound (bits) :srcset: /auto_examples/04_validation/images/sphx_glr_plot_06_reports_002.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 6.008 seconds) .. _sphx_glr_download_auto_examples_04_validation_plot_06_reports.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: binder-badge .. image:: images/binder_badge_logo.svg :target: https://mybinder.org/v2/gh/ComplexSystemsIntelligence/easyiec/main?urlpath=lab/tree/notebooks/auto_examples/04_validation/plot_06_reports.ipynb :alt: Launch binder :width: 150 px .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_06_reports.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_06_reports.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_06_reports.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_