Metadata-Version: 2.5
Name: easyiec
Version: 1.0
Summary: Interactive evolutionary computation with human, simulated and AI evaluators: interactive GA/ES/CMA-ES/PSO/DE, quality-diversity, preferential Bayesian optimization, LLM/VLM judges, panels, risk-controlled human escalation, and tools to validate, benchmark and visualize interactive optimization — the successor of the EASY-IEC MATLAB toolbox.
Project-URL: Homepage, https://github.com/ComplexSystemsIntelligence/easyiec
Project-URL: Documentation, https://complexsystemsintelligence.github.io/easyiec
Project-URL: Repository, https://github.com/ComplexSystemsIntelligence/easyiec
Project-URL: Issues, https://github.com/ComplexSystemsIntelligence/easyiec/issues
Project-URL: Changelog, https://github.com/ComplexSystemsIntelligence/easyiec/blob/main/CHANGELOG.md
Project-URL: Book (PDF), https://complexsystemsintelligence.github.io/easyiec/easyiec-book.pdf
Author-email: János Abonyi <janos@abonyilab.com>
License-Expression: MIT
License-File: LICENSE
Keywords: CMA-ES,IEC,LLM-as-a-judge,evolution strategies,evolutionary art,human-in-the-loop optimization,inter-rater agreement,interactive evolutionary computation,particle swarm,preferential Bayesian optimization,process engineering,simulated users,user fatigue,vision language models
Classifier: Development Status :: 5 - Production/Stable
Classifier: Framework :: Jupyter
Classifier: Intended Audience :: Education
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Artistic Software
Classifier: Topic :: Scientific/Engineering
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Scientific/Engineering :: Visualization
Requires-Python: >=3.10
Requires-Dist: matplotlib>=3.7
Requires-Dist: networkx>=3.0
Requires-Dist: numpy>=1.24
Requires-Dist: pandas>=2.0
Requires-Dist: pillow>=10.0
Requires-Dist: scipy>=1.11
Provides-Extra: all
Requires-Dist: ipywidgets>=8.0; extra == 'all'
Requires-Dist: scikit-image>=0.21; extra == 'all'
Requires-Dist: scikit-learn>=1.3; extra == 'all'
Provides-Extra: book
Requires-Dist: beautifulsoup4>=4.12; extra == 'book'
Requires-Dist: ipywidgets>=8.0; extra == 'book'
Requires-Dist: lxml; extra == 'book'
Requires-Dist: scikit-image>=0.21; extra == 'book'
Requires-Dist: scikit-learn>=1.3; extra == 'book'
Provides-Extra: dev
Requires-Dist: build; extra == 'dev'
Requires-Dist: ipywidgets>=8.0; extra == 'dev'
Requires-Dist: myst-parser; extra == 'dev'
Requires-Dist: numpydoc; extra == 'dev'
Requires-Dist: pydata-sphinx-theme; extra == 'dev'
Requires-Dist: pytest-cov; extra == 'dev'
Requires-Dist: pytest>=7; extra == 'dev'
Requires-Dist: ruff; extra == 'dev'
Requires-Dist: scikit-image>=0.21; extra == 'dev'
Requires-Dist: scikit-learn>=1.3; extra == 'dev'
Requires-Dist: sphinx-copybutton; extra == 'dev'
Requires-Dist: sphinx-design; extra == 'dev'
Requires-Dist: sphinx-gallery>=0.15; extra == 'dev'
Requires-Dist: sphinx>=7; extra == 'dev'
Requires-Dist: twine; extra == 'dev'
Provides-Extra: docs
Requires-Dist: ipywidgets>=8.0; extra == 'docs'
Requires-Dist: myst-parser; extra == 'docs'
Requires-Dist: numpydoc; extra == 'docs'
Requires-Dist: pydata-sphinx-theme; extra == 'docs'
Requires-Dist: scikit-image>=0.21; extra == 'docs'
Requires-Dist: scikit-learn>=1.3; extra == 'docs'
Requires-Dist: sphinx-copybutton; extra == 'docs'
Requires-Dist: sphinx-design; extra == 'docs'
Requires-Dist: sphinx-gallery>=0.15; extra == 'docs'
Requires-Dist: sphinx>=7; extra == 'docs'
Provides-Extra: ml
Requires-Dist: scikit-image>=0.21; extra == 'ml'
Requires-Dist: scikit-learn>=1.3; extra == 'ml'
Provides-Extra: notebook
Requires-Dist: ipywidgets>=8.0; extra == 'notebook'
Provides-Extra: test
Requires-Dist: ipywidgets>=8.0; extra == 'test'
Requires-Dist: pytest-cov; extra == 'test'
Requires-Dist: pytest>=7; extra == 'test'
Description-Content-Type: text/markdown

<p align="center"><img src="https://raw.githubusercontent.com/ComplexSystemsIntelligence/easyiec/main/docs/_static/banner.png" alt="easyiec: interactive evolutionary computation with human, simulated and AI evaluators"></p>

# easyiec: interactive evolutionary computation with human, simulated and AI evaluators

[![docs](https://img.shields.io/badge/docs-gallery%20%2B%20API-285780)](https://complexsystemsintelligence.github.io/easyiec)
[![book](https://img.shields.io/badge/book-PDF%20%C2%B7%20web-D55E00)](https://complexsystemsintelligence.github.io/easyiec/book.html)
[![License: MIT](https://img.shields.io/badge/license-MIT-green.svg)](https://github.com/ComplexSystemsIntelligence/easyiec/blob/main/LICENSE)

**easyiec** optimizes things whose quality is judged rather than computed — a
controller response, a fermentation profile, a photo grading, a fractal, a
colour palette, a melody, a slogan. In *interactive evolutionary computation*
(IEC) the fitness function of an evolutionary algorithm is replaced by an
evaluator who looks at the candidates and chooses (Takagi, 2001). The package is
the Python successor of the EASY-IEC MATLAB toolbox (Madár, Abonyi and Szeifert,
[Comput. Chem. Eng. 29(7), 2005](https://doi.org/10.1016/j.compchemeng.2004.12.009)),
extended in three directions:

1. **Algorithms** — interactive GA, self-adaptive ES (the EASY-IEC algorithm),
   CMA-ES, interactive PSO (Madár et al., 2005), pairwise differential evolution,
   the Blind Watchmaker, interactive MAP-Elites, novelty-filtered IEC,
   reference-point NSGA-II, preferential Bayesian optimization, sequential line
   search and sequential gallery, surrogate-assisted fatigue reduction, verbal
   steering with fuzzy linguistic hedges and Lamarckian direct manipulation.
2. **Evaluators** — people (Jupyter/Colab gallery, desktop matplotlib gallery,
   console), simulated users with known ground truth (Thurstone/BTL noise,
   fatigue, lapses, position bias, drift), metric evaluators, **LLM and VLM
   judges** (Claude, OpenAI-compatible, Gemini, Ollama; offline mock),
   persona panels and **hybrid evaluation that escalates uncertain queries to a
   person under a calibrated risk-control policy**.
3. **Evaluation science** — agreement statistics, judge diagnostics (swap test,
   transitivity, self-consistency, calibration), **psychometric audits of AI
   judges**, the alternative annotator test, prediction-powered inference,
   factorial benchmarks with simulated users, statistical comparison and some
   twenty visualizations of IEC processes, plus HTML session reports.

| Module | Contents |
|---|---|
| `easyiec.core` | `Box` search spaces, `Individual`, `Query`/`Feedback` with seven protocols (select, rank, rate, pairs, best–worst, line, edit), `Problem`, `Session` with budgets, oracles and complete logs |
| `easyiec.strategies` | `InteractiveGA`, `InteractiveES`, `EasyIEC`, `Watchmaker`, `InteractiveCMAES`, `InteractivePSO`, `InteractiveDE`, `InteractiveMAPElites`, `NoveltyIEC`, `InteractiveNSGA2`, `PreferentialBO`, `SequentialLineSearch`, `SequentialGallery`, `SurrogateAssisted`, `RandomSearch` |
| `easyiec.preference` | Bradley–Terry (linear, random-feature), GP preference learning (Laplace), Borda, Copeland, Kemeny, Elo, cyclic triads |
| `easyiec.evaluators` | `SimulatedUser`, `MetricEvaluator`, `LLMJudge`, `Panel`, `PersonaPanel`, `EscalationEvaluator`, `HumanProxy`, `ConsoleEvaluator`, `VerbalSteering`, API clients with disk cache |
| `easyiec.problems` | 25 problems: PID and CSTR (PID/DMC) tuning, beer fermentation, fuzzy partitions, path planning, photo enhancement, segmentation with ground truth, Julia sets, attractors, IFS, fractal flames, CPPN images, harmonographs, biomorphs, L-systems, cellular automata, superformula logos, palettes, chart styles, Chernoff faces, network drawings, melodies, slogans, synthetic landscapes |
| `easyiec.validation` | Kendall, Spearman, RBO, Cohen/Fleiss κ, Krippendorff α, Kendall W, ICC; position consistency and bias, self-consistency, transitivity, psychometric audit, calibration; alt-test, PPI; curves, burden, diversity; bootstrap, A12, Holm, Friedman–Nemenyi; `run_benchmark`, `compare_evaluators` |
| `easyiec.viz` | galleries, film strips, genealogies, lineages, PCA/MDS/t-SNE maps, anytime curves, gene trajectories, preference landscapes, Pareto fronts, strategy states, agreement heatmaps, psychometric curves, position bias, escalation timelines, calibration, critical-difference diagrams, GIF animations, HTML reports |
| `easyiec.ui` | `JupyterGallery` (ipywidgets, AI prefill, gene editor), `MatplotlibGallery` (EASY-IEC-style figure, draggable knots) |
| `easyiec.compat` | the MATLAB workflow: `popu_init`, user functions, `ies_main` |

## Installation

```bash
pip install easyiec
pip install "easyiec[all]"     # + ipywidgets, scikit-learn, scikit-image
```

Python ≥ 3.10; depends on numpy, scipy, matplotlib, pandas, networkx and Pillow.
The LLM clients use only the standard library.

## Quick start

```python
import easyiec as ei
from easyiec.problems import JuliaSet, BeerFermentation
from easyiec.strategies import InteractiveGA, InteractiveCMAES

# 1) you are the evaluator (Jupyter, JupyterLab, VS Code, Colab)
ei.ui.JupyterGallery(JuliaSet(), InteractiveGA(pop_size=9))

# 2) a simulated user with a hidden target: reproducible benchmarks with ground truth
p = BeerFermentation()
user = ei.SimulatedUser(p, target="default", noise=0.05, fatigue=0.5, seed=1)
res = ei.run(p, InteractiveCMAES(), user, generations=20, seed=1)
print(res.best_true, p.describe(res.best.genome))

# 3) an LLM/VLM judge (Claude), debiased by presentation-order swaps
from easyiec.evaluators import AnthropicClient, LLMJudge
judge = LLMJudge(AnthropicClient("claude-sonnet-5-5"), JuliaSet(),
                 goal="an intricate, glowing spiral in cool colours")
res = ei.run(JuliaSet(), InteractiveGA(), judge, generations=10)

# 4) the AI answers, people are asked only when the AI is unsure
from easyiec.evaluators import EscalationEvaluator, HumanProxy
hybrid = EscalationEvaluator(judge, HumanProxy(), policy="rate", target_rate=0.25)
# policy="risk" with calibration labels keeps the AI-only disagreement below a tolerance
ei.ui.JupyterGallery(JuliaSet(), InteractiveGA(), evaluator=hybrid)
```

Validate a judge before trusting it:

```python
from easyiec.validation import audit_judge, psychometric_audit
audit = audit_judge(judge, JuliaSet(), goal="Choose the more beautiful fractal.")
psy = psychometric_audit(judge, JuliaSet(), "brightness", goal="Choose the brighter image.")
ei.viz.plot_psychometric(psy)
```

## Documentation and book

* Documentation, example gallery and API reference: <https://complexsystemsintelligence.github.io/easyiec>
* The companion book, *Interactive Evolutionary Computation in Python: Human,
  Simulated and AI Evaluators — The easyiec toolbox* (CC BY 4.0):
  [PDF](https://complexsystemsintelligence.github.io/easyiec/easyiec-book.pdf),
  [web edition](https://complexsystemsintelligence.github.io/easyiec/book/index.html)

## Citing

If you use easyiec, please cite the software (see `CITATION.cff`) and the
original publications of the methods you use; the EASY-IEC method itself:

> Madár, J., Abonyi, J., Szeifert, F. (2005). Interactive evolutionary
> computation in process engineering. *Computers & Chemical Engineering*,
> 29(7), 1591–1597. https://doi.org/10.1016/j.compchemeng.2004.12.009

## Acknowledgement

The development was supported by the National Research, Development and
Innovation Office of Hungary (NKFIH, OTKA 143482).

## License

MIT (software); the book is CC BY 4.0.
