# Analysis Rules

Read the root `AGENTS.md` first. These rules refine it for analysis work.

## Scripts and Notebooks
- Use `scripts/` for reusable functions; `notebooks/` for exploration.
- Each notebook begins with a purpose statement.
- Save model outputs to `outputs/` with descriptive filenames.

## Validation
- Keep validation scripts in `analysis/validation/`.
- Report class-level precision and recall, not just accuracy.
- Compare every model against a majority-class baseline.
- Log model settings, random seeds, and software versions in the run notes.

## Data Access
- Read processed data from `data/processed/`.
- Write interim checkpoints to `data/interim/`.
- Never read directly from `data/raw/` in analysis scripts; use the processed version.

## Reproducibility
- Set and record a random seed in any script involving stochastic algorithms.
- Fit feature transformations on training data only; never on the full dataset.
