Commit 335de3d
Add PanelProfile outcome_shape + treatment_dose extensions and autonomous-guide worked examples (Wave 2)
Wave 2 of the AI-agent enablement track. Extends profile_panel() with two
new optional sub-dataclasses:
- OutcomeShape (numeric outcomes only): n_distinct_values, pct_zeros,
value_min/max, NaN-safe skewness + excess_kurtosis (gated on
n_distinct >= 3 and std > 0), is_integer_valued, is_count_like (heuristic:
integer-valued AND has zeros AND right-skewed AND > 2 distinct values),
is_bounded_unit ([0, 1] support).
- TreatmentDoseShape (treatment_type == "continuous" only):
n_distinct_doses, has_zero_dose, dose_min/max/mean over non-zero doses,
is_time_invariant (per-unit non-zero doses have at most one distinct
value).
Both fields are None when their classification gate is not met. to_dict()
serializes the nested dataclasses as JSON-compatible nested dicts.
llms-autonomous.txt gains a new §5 "Worked examples" with three end-to-end
PanelProfile -> reasoning -> validation walkthroughs (binary staggered
with never-treated controls, continuous dose with zero baseline,
count-shaped outcome) plus §2 field-reference subsections, §3 footnote
cross-ref, §4.7 cross-ref, and a new §4.11 outcome-shape considerations
section. Existing §5-§8 renumbered to §6-§9. Descriptive only - no
recommender language inside the worked examples.
Tests: 16 new unit tests in tests/test_profile_panel.py covering each
heuristic (count-like Poisson, binary-as-not-count-like, continuous
normal, bounded unit, categorical returning None, skewness gating,
JSON roundtrip, time-invariant dose, time-varying dose, no-zero-dose,
binary-treatment returning None, categorical-treatment returning None,
JSON roundtrip, frozen invariants on both new dataclasses). Two new
content-stability tests in tests/test_guides.py guard the §5 worked
examples and the new field references.
CHANGELOG and ROADMAP updated; ROADMAP marks Wave 2 shipped, promotes
sanity_checks block to top of "Next blocks toward the vision," and
documents why the originally-proposed post-hoc mismatch detection was
rescoped (largely overlaps existing fit-time validators and caveats).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 4852b34 commit 335de3d
7 files changed
Lines changed: 818 additions & 17 deletions
File tree
- diff_diff
- guides
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
138 | 138 | | |
139 | 139 | | |
140 | 140 | | |
141 | | - | |
| 141 | + | |
142 | 142 | | |
143 | 143 | | |
144 | 144 | | |
145 | 145 | | |
146 | 146 | | |
147 | | - | |
148 | | - | |
| 147 | + | |
| 148 | + | |
149 | 149 | | |
150 | 150 | | |
151 | 151 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
250 | 250 | | |
251 | 251 | | |
252 | 252 | | |
253 | | - | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
254 | 260 | | |
255 | 261 | | |
256 | 262 | | |
| |||
498 | 504 | | |
499 | 505 | | |
500 | 506 | | |
| 507 | + | |
| 508 | + | |
501 | 509 | | |
502 | 510 | | |
503 | 511 | | |
0 commit comments