Metadata-Version: 2.4
Name: xrtm-train
Version: 0.1.2
Summary: The Learning/Optimization layer for XRTM.
Author-email: XRTM Team <moy@xrtm.org>
License: Apache-2.0
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: pydantic>=2.0.0
Requires-Dist: numpy>=1.24.0
Requires-Dist: scikit-learn>=1.3.0
Requires-Dist: xrtm-data
Requires-Dist: xrtm-eval>=0.1.1
Requires-Dist: xrtm-forecast
Provides-Extra: dev
Requires-Dist: pytest>=7.0.0; extra == "dev"
Requires-Dist: pytest-asyncio>=0.21.0; extra == "dev"
Requires-Dist: pytest-cov>=4.1.0; extra == "dev"
Requires-Dist: ruff>=0.1.0; extra == "dev"
Requires-Dist: mypy>=1.0.0; extra == "dev"
Dynamic: license-file

# xrtm-train

[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
[![Python](https://img.shields.io/badge/python-3.11+-blue.svg)](https://www.python.org/downloads/)

**The Optimization Layer for XRTM.**

`xrtm-train` is the engine that closes the loop. It simulates history by replaying agents against past "Ground Truth" snapshots stored in `xrtm-data`, scoring them with `xrtm-eval`, and optimizing their reasoning parameters.

## Installation

```bash
uv pip install xrtm-train
```

## Core Primitives

### The Simulation Loop
The `Backtester` orchestrates the simulation. It ensures strict temporal isolation—agents are never exposed to data from the future.

```python
from xrtm.train import Backtester

# Initialize components
backtester = Backtester(agent=my_agent, evaluator=my_evaluator)

# Run simulation
results = await backtester.run(dataset=historical_questions)
print(f"Mean Brier Score: {results.mean_score}")
```

## Development

Prerequisites:
- [uv](https://github.com/astral-sh/uv)

```bash
# Install dependencies
uv sync

# Run tests
uv run pytest
```
