{
  "cells": [
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "# Claude for Research & Academia \u2014 Intermediate\n",
        "\n",
        "## Learning Objectives\n",
        "- Data management plans assisted by LLMs\n",
        "- IRB-sensitive workflows and limitations\n",
        "- Collaboration patterns for lab teams\n",
        "\n",
        "## Time Estimate\n",
        "**2\u20133 hours**\n",
        "\n",
        "## Notebook Intent\n",
        "This notebook is designed to be run top-to-bottom. Each section ends with a small checkpoint you can reuse in your own projects.\n",
        "\n",
        "---\n"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "## Guided Practice \u2014 Constraints + measurement\n",
        "\n",
        "You will:\n",
        "- implement a small, testable unit of logic\n",
        "- interpret the results in domain terms for **Claude for Research & Academia**\n",
        "- identify the next experiment that would most improve outcomes\n"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {},
      "outputs": [],
      "source": [
        "from __future__ import annotations\n",
        "\n",
        "from dataclasses import dataclass\n",
        "from statistics import mean\n",
        "from typing import Iterable, Tuple\n",
        "\n",
        "\n",
        "@dataclass\n",
        "class Metric:\n",
        "    name: str\n",
        "    value: float\n",
        "\n",
        "\n",
        "def pareto_frontier(points: Iterable[Tuple[float, float]]) -> list[tuple[float, float]]:\n",
        "    \"\"\"Very small pareto frontier demo for cost vs quality.\"\"\"\n",
        "    pts = list(points)\n",
        "    dominated = set()\n",
        "    for i, (qi, ci) in enumerate(pts):\n",
        "        for j, (qj, cj) in enumerate(pts):\n",
        "            if i == j:\n",
        "                continue\n",
        "            if qj >= qi and cj <= ci and (qj > qi or cj < ci):\n",
        "                dominated.add(i)\n",
        "                break\n",
        "    return [pts[i] for i in range(len(pts)) if i not in dominated]\n",
        "\n",
        "\n",
        "metrics = [\n",
        "    Metric(\"quality\", 0.78),\n",
        "    Metric(\"consistency\", 0.83),\n",
        "    Metric(\"latency_ms\", 920),\n",
        "]\n",
        "\n",
        "{\"avg_quality_proxy\": round(mean([m.value for m in metrics[:2]]), 3), \"latency_ms\": metrics[2].value}\n"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "## Exercise (Notebook)\n",
        "Pick one metric you care about for **Claude for Research & Academia** (quality, latency, cost, risk).\n",
        "\n",
        "1. Write down how you will measure it (even if approximate).\n",
        "2. Change one part of the code cell and rerun.\n",
        "3. Record what improved and what regressed.\n",
        "\n",
        "## Stretch\n",
        "Turn the code cell into a function with type hints and add one negative test (an input that should fail).\n"
      ]
    }
  ],
  "metadata": {
    "kernelspec": {
      "display_name": "Python 3",
      "language": "python",
      "name": "python3"
    },
    "language_info": {
      "name": "python",
      "version": "3.10.0",
      "mimetype": "text/x-python",
      "codemirror_mode": {
        "name": "ipython",
        "version": 3
      },
      "file_extension": ".py",
      "nbconvert_exporter": "python",
      "pygments_lexer": "ipython3"
    }
  },
  "nbformat": 4,
  "nbformat_minor": 4
}
