Skip to main content
Ctrl+K

easyiec

  • Installation
  • Example gallery
  • AI judges, people and notebooks
  • API reference
  • The book
    • From the MATLAB toolbox
    • Citing
    • Changelog
    • All textbooks
  • GitHub
  • Installation
  • Example gallery
  • AI judges, people and notebooks
  • API reference
  • The book
  • From the MATLAB toolbox
  • Citing
  • Changelog
  • All textbooks
  • GitHub

Section Navigation

  • First steps: sessions, protocols, spaces and logs
    • A first interactive session: evolving a Julia set
    • Seven ways to answer: feedback protocols
    • Search spaces and the problem zoo
    • Everything is logged: genealogy, lineage and the map of a session
    • From the MATLAB toolbox: the popu workflow
  • Interactive algorithms
    • The EASY-IEC algorithm: a self-adaptive evolution strategy driven by clicks
    • CMA-ES, interactive PSO and pairwise differential evolution
    • Preferential Bayesian optimization, line search and gallery
    • Interactive MAP-Elites: a diverse archive instead of one winner
    • Many objectives, one person: reference-point NSGA-II
    • Fighting fatigue with a surrogate of the evaluator
    • The Blind Watchmaker and novelty-filtered galleries
  • Evaluators: simulated users, AI judges, panels and people
    • Simulated users: benchmarking with a known ground truth
    • An AI judge in the loop: prompts, images and debiasing
    • Panels: several evaluators, one decision
    • Hybrid evaluation: the AI answers, people decide the hard cases
    • Verbal steering: “much brighter, slightly less saturated”
    • Learning a utility from comparisons
  • Validation and benchmarking
    • Auditing a judge before trusting it
    • Psychometric audit: how small a difference can the judge see?
    • May the AI replace the annotators? The alt-test and prediction-powered inference
    • A factorial benchmark with simulated users
    • A judge-substitution study
    • Reports, animations and the burden of a session
  • Engineering applications
    • PID tuning by looking at step responses
    • Controlling an exothermic reactor at its unstable steady state
    • Designing a beer fermentation temperature profile
    • Fuzzy partitions and robot paths: geometry an expert can judge
    • Tuning an image-segmentation pipeline with a ground truth
  • Visual, creative and design applications
    • Fractals: Julia sets, strange attractors, IFS and flames
    • Generative art: CPPNs, harmonographs, superformula and cellular automata
    • Artificial life: biomorphs and L-system plants
    • Design: palettes, chart styles, faces and network drawings
    • Photo enhancement: grading an image by eye
    • Beyond images: melodies and slogans
  • Working with Claude (needs an API key, not executed in the gallery)
    • Claude as the evaluator of a session
    • Validating Claude as a judge
    • You and Claude together in a notebook gallery
  • Example gallery
  • Interactive algorithms
  • Preferential Bayesian optimization, line search and gallery

Note

Go to the end to download the full example code or to run this example in your browser via Binder.

Preferential Bayesian optimization, line search and gallery#

When every answer is expensive, a statistical model of the evaluator’s preferences pays off. A Gaussian process is fitted to pairwise answers with the probit likelihood of Chu and Ghahramani (2005); the next comparison is chosen by an acquisition function (González et al., 2017). Sequential line search (Koyama et al., 2017) asks for the best point on a slider through the incumbent, and the sequential gallery (Koyama et al., 2020) for the best cell of a 2-D grid — far more information per question than a single pair.

Three model-based strategies on a two-dimensional landscape#

import matplotlib.pyplot as plt
import numpy as np

import easyiec as ei
from easyiec.problems import SyntheticPreference
from easyiec.strategies import PreferentialBO, SequentialGallery, SequentialLineSearch

problem = SyntheticPreference(dim=2, kind="ellipsoid", seed=4)
runs = {}
for name, strategy in {"PBO (pairs)": PreferentialBO(), "line search (slider)": SequentialLineSearch(n_samples=7),
                       "gallery (3×3 grid)": SequentialGallery(grid=3)}.items():
    user = ei.SimulatedUser(problem, target="random", noise=0.03, seed=8)
    runs[name] = (strategy, user, ei.run(problem, strategy, user, generations=15, seed=8))
    print(f"{name:22s} best utility {runs[name][2].best_true:.3f} after {runs[name][2].summary()['queries']} questions")
PBO (pairs)            best utility 0.900 after 15 questions
line search (slider)   best utility 0.710 after 15 questions
gallery (3×3 grid)     best utility 0.990 after 15 questions

Learned utility versus the hidden one#

Top left: the hidden utility of the simulated user. The other panels show the GP posterior mean of each strategy with the shown points (white) and the chosen ones (circles).

fig, axes = plt.subplots(2, 2, figsize=(9.4, 8))
g = np.linspace(0, 1, 70)
A, B = np.meshgrid(g, g)
user = runs["PBO (pairs)"][1]
U = np.array([problem.utility(problem.space.denormalize(np.array([a, b])), user.target)
              for a, b in zip(A.ravel(), B.ravel())]).reshape(A.shape)
cs = axes[0, 0].contourf(A, B, U, levels=20, cmap="viridis")
plt.colorbar(cs, ax=axes[0, 0], shrink=0.85, label="hidden utility")
axes[0, 0].set_title("hidden utility of the simulated user", fontsize=9)
for ax, (name, (strategy, _, res)) in zip(axes.flat[1:], runs.items()):
    ei.viz.plot_preference_landscape(strategy.model, problem, log=res.log, ax=ax)
    ax.set_title(name, fontsize=9)
fig.tight_layout()
hidden utility of the simulated user, PBO (pairs), line search (slider), gallery (3×3 grid)

Utility per question#

A line or gallery answer carries several pairwise preferences at once.

fig, ax = plt.subplots(figsize=(6.4, 3.4))
for k, (name, (_, _, res)) in enumerate(runs.items()):
    ei.viz.plot_anytime(res, ax=ax, x="n_queries", label=name, color=["#285780", "#D55E00", "#009E73"][k],
                        show_shown=False)
ax.legend(frameon=False, fontsize=8)
ax.set_title("best utility vs. number of questions", fontsize=9)
plt.show()
best utility vs. number of questions

Total running time of the script: (0 minutes 0.792 seconds)

Launch binder

Download Jupyter notebook: plot_03_bayesian.ipynb

Download Python source code: plot_03_bayesian.py

Download zipped: plot_03_bayesian.zip

Gallery generated by Sphinx-Gallery

previous

CMA-ES, interactive PSO and pairwise differential evolution

next

Interactive MAP-Elites: a diverse archive instead of one winner

On this page
  • Three model-based strategies on a two-dimensional landscape
  • Learned utility versus the hidden one
  • Utility per question
Show Source

© Copyright 2026, János Abonyi.

Created using Sphinx 9.1.1.