Metadata-Version: 2.4
Name: csa_prediction_engine
Version: 2.5.1
Summary: The csa_prediction_engine library provides a suite of tools and functions for performing relevance-based predictions using the Cambridge Sports Analytics Prediction Engine API. The package is designed to facilitate single and multi-task predictions, allowing for flexible model evaluation and experimentation.
Author: Cambridge Sports Analytics
Author-email: prediction@csanalytics.io
Description-Content-Type: text/markdown
Requires-Dist: numpy>=2.1
Requires-Dist: requests
Requires-Dist: csa_common_lib>=2.5.1
Dynamic: author
Dynamic: author-email
Dynamic: description
Dynamic: description-content-type
Dynamic: requires-dist
Dynamic: summary

# Cambridge Sports Analytics Prediction Engine

The **CSA Prediction Engine** is the official Python client for interacting with the Cambridge Sports Analytics (CSA) API. It enables relevance-based predictions using flexible configurations, including support for batch jobs, grid evaluations, and multi-task prediction workflows.

**Source code:** [github.com/CambridgeSportsAnalytics/csa_prediction_engine](https://github.com/CambridgeSportsAnalytics/csa_prediction_engine)

## Key features

- **Single task predictions**: One dependent variable and one set of circumstances.
- **Multi-y predictions**: Multiple dependent variables with a single set of circumstances.
- **Multi-theta predictions**: One dependent variable with multiple sets of circumstances.
- **Relevance-based grid predictions**: Optimal composite prediction across thresholds and variable combinations.
- **Grid singularity predictions**: Highest adjusted-fit prediction from the grid.
- **MaxFit predictions**: Best-fit model from adjusted relevance.

## Installation

Install from PyPI:

```bash
pip install csa-prediction-engine
```

Requires Python 3.11.

## Package layout

```text
csa_prediction_engine/
├── api_client.py                 # Public API: predict_*, decorators, quota helpers
├── bin/
│   ├── _workers.py               # Worker implementations for prediction tasks
│   └── single_tasks.py           # Single-task CLI-style entry helpers
├── helpers/
│   ├── _auth_manager.py          # API authentication
│   ├── _details_handler.py       # Model details retrieval and storage
│   ├── _payload_handler.py       # Request payloads and endpoint routing
│   ├── _postmaster.py            # Internal HTTP / communication helpers
│   └── _router.py                # Task routing from configuration
├── parallel/
│   ├── _dispatchers.py           # Parallel task dispatch
│   ├── _threaded_predictions.py  # Threaded async prediction runs
│   └── _workers.py               # Parallel worker processes
├── version.py                    # Package version string
└── __init__.py
```

## Documentation and examples

For OpenAPI specs, quickstart examples, and tutorials, see the companion repository:

[CSA Prediction Engine quickstart](https://github.com/CambridgeSportsAnalytics/prediction_engine_quickstart)

## Contributing

Bug reports and feature requests are welcome. Reach out to the team at support@csanalytics.io.

## License

Copyright (c) 2023–2026 Cambridge Prediction Analytics, LLC. All rights reserved.
