{"data":{"kind":"file","path":"README.md","version_id":"nalqv62fojxhagj0862c1sqn","entry":{"name":"README.md","path":"README.md","is_directory":false,"size":5305,"modified_at":"2026-02-18T10:22:19.698000","content_hash":"116e5618f10a12ba9f1519d2fef479adc922f17dbbc87c35795bc3e677b3d038"},"entries":[],"content":"# business-valuation\n\nSingle-turn **RL environment** for **Business Valuation**. This package is **only the environment** (dataset, prompt builder, rubric); training and evaluation are run by Prime Intellect (`prime eval run`, `prime rl run`).\n\n**Methods:** REVENUE_MULTIPLE, EBITDA_MULTIPLE, DCF (perpetuity or explicit FCF + terminal value), COMPARABLES (revenue or EBITDA peer multiples).\n\n**Environment criteria:** **Dataset** — bundled `valuation_dataset.json`; train/eval split via `num_eval_examples`. **Harness** — single-turn chat (`vf.SingleTurnEnv`). **Rubric** — binary (default) or continuous; optional state columns.\n\nTask:\n1. **Estimate enterprise value** (or equity value) from given inputs\n2. **State the method** (REVENUE_MULTIPLE, EBITDA_MULTIPLE, DCF, COMPARABLES)\n3. **Provide reasoning** in structured JSON\n\n## Reward (0–1)\n\n**Default: binary.** Rubric returns **1.0** only when (1) estimated value is within a relative tolerance (default 5%) of the true value and (2) method matches; otherwise **0.0**.\n\n**Optional: continuous** (`use_binary_reward=False`). Raw 0–100: accuracy (0–70), method (0–20), reasoning heuristic (0–10); normalized to 0–1.\n\n## State columns (saved evals)\n\nUse `prime eval run ... --save-results -C binary_correct,reasoning_points,accuracy_points,method_points` to save:\n\n| Column | Meaning |\n| ------ | ------- |\n| `binary_correct` | Whether value and method were correct (binary mode). |\n| `reasoning_points` | 0–10 keyword-based reasoning score (analysis only). |\n| `accuracy_points` | 0–70 from valuation accuracy (continuous component). |\n| `method_points` | 0 or 20 from correct method (continuous component). |\n\n## Dataset\n\n**2,100 problems** in total (bundled as `valuation_dataset.json`): **~95.2% synthetic**, **~4.8% real** (curated from published examples: Investopedia, CFI, Wall Street Prep, ValuAdder, etc.). Methods: revenue multiple, EBITDA multiple, DCF (perpetuity or multi-year + terminal value), comparables (revenue or EBITDA peer multiples).\n\n**Synthetic generation (rigorous and objective):** The ~2,000 synthetic problems are produced by the parent repo’s `dataset.py` with a **seeded RNG** (`seed=42`, reproducible) and **stratified by method** (e.g. 40% revenue multiple, 30% EBITDA, 20% DCF, 10% comparables). Parameter ranges are derived from the 100 real cases and capped to typical SME/mid-market sizes. For each problem, the **true enterprise value is computed deterministically** in code: revenue × multiple, EBITDA × multiple, DCF (Gordon growth or explicit FCF + terminal value formula), or average(peer multiples) × metric. Valuation is a mathematically well-defined problem per method—one correct EV per input, no subjective grading. To regenerate or extend: from **BV_ENV** run `python dataset.py [N]` (e.g. `python dataset.py 500`), then copy the generated file here or pass `dataset_path` to `load_environment()`.\n\n## Quickstart\n\n```bash\nprime env install business-valuation -p ./environments\nprime eval run business-valuation -m google/gemini-2.5-flash -n 5\n```\n\n```python\nfrom business_valuation import load_environment\nenv = load_environment()  # binary reward\nenv_cont = load_environment(use_binary_reward=False)  # continuous 0-1\n```\n\n## Full dataset (avoid 1-example fallback)\n\nWhen the package is installed **without** `valuation_dataset.json` (e.g. from Prime Hub source install), the env uses a single minimal example. To get the full 2,100-example dataset and have `-n 20` (or any `-n`) honored:\n\n1. **Set `VALUATION_DATASET_URL`** to a public HTTPS URL of `valuation_dataset.json`. The env will download and cache it (e.g. under `~/.cache/business_valuation/`).\n   - **Local:** `export VALUATION_DATASET_URL='https://raw.githubusercontent.com/USER/REPO/branch/path/to/valuation_dataset.json'` (use your repo URL), then run `prime eval run dsm/business-valuation -n 20 ...`.\n   - **Prime dashboard:** In your environment (e.g. dsm/business-valuation) → Settings → Secrets or Environment variables, add `VALUATION_DATASET_URL` with that URL so cloud evals get the full dataset.\n2. **Or install from a wheel that includes the file:** From this directory run `uv build --wheel`, then `pip install dist/business_valuation-*.whl`. The wheel built with the file present contains the dataset.\n\n## Environment Arguments\n\n| Arg | Default | Description |\n| --- | ------- | ----------- |\n| `dataset_path` | `None` | Path to `valuation_dataset.json`; if None, uses bundled |\n| `num_eval_examples` | `-1` | If > 0, hold out for eval |\n| `use_binary_reward` | `True` | If True, rubric 1.0/0.0; if False, continuous 0–1 |\n| `valuation_tolerance` | `0.05` | Relative tolerance for value (5%) |\n\n**Env var (no bundle):** `VALUATION_DATASET_URL` — when the package has no bundled dataset, set this to an HTTPS URL of `valuation_dataset.json` to download and use the full dataset.\n\n## Hosted Training notes\n\n- **Baseline:** Run a baseline eval before training; target reward in the 10–80% band (see Prime docs). Adjust `valuation_tolerance` or model if outside.\n- **Thinking models:** For valuation reasoning, consider Thinking variants (e.g. `Qwen/Qwen3-4B-Thinking-2507`) as recommended for math/reasoning tasks.\n\n## Requirements\n\n- Python ≥3.10\n- verifiers>=0.1.8\n- datasets>=2.14.0\n","encoding":"utf-8","truncated":false,"total_bytes":5305},"status":null}