Skip to content

Classify dose-response shape (interior-optimum / monotonic-to-cliff / flat) #27

Description

@bamdadd

Context

The README's central finding is that architectures differ in dose-response shape: an interior optimum (effect peaks then reverses past the cliff), monotonic-to-cliff (best usable effect is the last coherent dose), or flat (a broken/low-SNR vector). Today a reader must eyeball the curve to tell these apart. A typed classifier on the analysis makes the shape a first-class, testable output.

Proposal

Add a small enum-like classifier that labels a dose curve as interior_optimum, monotonic_to_cliff, or flat, computed purely from the aggregated SweepPoint list plus the existing DoseAnalysis (sweet spot, cliff, coherent points). Attach the label to DoseAnalysis as a typed field and surface it in the summary lines.

Acceptance criteria

  • Add DoseShape = Literal["interior_optimum", "monotonic_to_cliff", "flat"] and populate a shape: DoseShape field on DoseAnalysis inside analyze_dose (pure, CPU-only).
  • Classification rule documented in the docstring, e.g.: flat when no coherent steered point clears baseline by a stated margin; interior_optimum when the max coherent effect shift occurs strictly before the last coherent dose; monotonic_to_cliff when the best coherent effect is the last coherent point.
  • Add the shape label to _effect_summary_lines so the card states which regime the vector is in.
  • CPU-only unit tests in tests/test_report.py covering all three shapes on hand-built two-sided curves (interior peak, monotone rise to cliff, flat). No model download.
  • ruff check ., ruff format --check ., mypy src, pytest -q all pass.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions