.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_examples/07_claude/claude_02_validation_study.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_07_claude_claude_02_validation_study.py: Validating Claude as a judge ============================ The study reported in the case-study chapter of the book: psychometric audits of brightness, facial expression and segmentation quality, swap and transitivity tests, a judge-substitution comparison with simulated people, closed-loop sessions and risk-controlled escalation — for two Claude models. ``tools/claude_validation.py`` runs all of it and writes ``results.json``; the call below runs a smaller version (``scale=0.5``). Expected cost at full scale: a few US dollars. .. GENERATED FROM PYTHON SOURCE LINES 15-17 Run the study ------------- .. GENERATED FROM PYTHON SOURCE LINES 17-30 .. code-block:: Python import json import sys sys.path.insert(0, "tools") from claude_validation import run_study # noqa: E402 from easyiec.evaluators import AnthropicClient # noqa: E402 clients = {m: AnthropicClient(m, effort="low", min_interval=0.2) for m in ["claude-haiku-5-5", "claude-sonnet-5-5"]} results = run_study(clients, out="claude_study", scale=0.5) print(json.dumps(results["usage"], indent=1)) # calls, tokens and USD per model print(results["V5"]["summary"]) # human share of the calibrated hybrid session .. GENERATED FROM PYTHON SOURCE LINES 31-33 A single psychometric audit --------------------------- .. GENERATED FROM PYTHON SOURCE LINES 33-42 .. code-block:: Python import easyiec as ei # noqa: E402 from easyiec.evaluators import LLMJudge # noqa: E402 from easyiec.problems import JuliaSet # noqa: E402 from easyiec.validation import psychometric_audit # noqa: E402 judge = LLMJudge(clients["claude-haiku-5-5"], JuliaSet(), debias="none", image_size=160) psy = psychometric_audit(judge, JuliaSet(), "brightness", goal="Choose the brighter image.", per_level=8) print(psy.summary()) ei.viz.plot_psychometric(psy) .. _sphx_glr_download_auto_examples_07_claude_claude_02_validation_study.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/07_claude/claude_02_validation_study.ipynb :alt: Launch binder :width: 150 px .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: claude_02_validation_study.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: claude_02_validation_study.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: claude_02_validation_study.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_