# Runnable examples

The examples reproduce the radial-class ratio minimization from the canonical
contract. The returned `risk_score` is deliberately named and explained; it is
not relabeled as an unconditional probability.

## Reproduce locally

Run these commands from this topic folder. Python 3.10+ uses only its standard library.

```bash
python examples/python_example.py
python -m unittest discover -s tests -p "test_*.py"
```

For TypeScript, use the repository's installed compiler and Node.js. The explicit-source command below uses the installed TypeScript 7.0.2 compiler's `--ignoreConfig` option:

```bash
node ../../../../../node_modules/typescript/bin/tsc --ignoreConfig --target ES2022 --module NodeNext --moduleResolution NodeNext --types node --strict --skipLibCheck --outDir .build examples/typescript_example.ts
node .build/examples/typescript_example.js
```

The Python/TypeScript fixture values and regression cases are shared. Use `status` and residuals before interpreting an iterative result. The lab embeds the compiled canonical TypeScript calculation and needs no server or network to compute.
