Introduction
Cambridge Sports Analytics Prediction Engine
The CSA Prediction Engine Python library provides a suite of tools and functions for performing relevance-based predictions using the Cambridge Sports Analytics (CSA) Prediction Engine API. The package is designed to facilitate single and multi-task predictions, allowing for flexible model evaluation and experimentation.
CSA Prediction Engine Package Structure
The package is structured as follows:
csa_prediction_engine/
├── api_client.py # Main module for user interactions
└── bin/ # Internal modules for task management
├── _workers.py # Executes various single prediction models
└── single_tasks.py # Handles single task predictions
└── helpers/ # Helper modules for internal operations
├── _auth_manager.py # Manages authentication for API access
├── _details_handler.py # Manages retrieval and storage of model details
├── _payload_handler.py # Manages API payload construction and processing
├── _postmaster.py # Manages internal communications
└── _router.py # Routes tasks based on input configurations
└── parallel/ # Modules for parallel processing
├── _dispatchers.py # Dispatches tasks to workers
├── _workers.py # Executes parallel tasks
└── _threaded_predictions.py # Handles predictions in a multi-threaded environment
└── __init__.py # Package initialization
Key Features
Single Task Predictions: Support for predictions with one dependent variable and one set of circumstances.
Multi-y Predictions: Perform predictions with multiple dependent variables and a single set of circumstances.
Multi-theta Predictions: Perform predictions with one dependent variable and multiple sets of circumstances.
Relevance-Based Grid Predictions: Generate optimal predictions by evaluating all thresholds and variable combinations.
MaxFit Predictions: Find the best-fit model based on adjusted relevance.
Requirements
To use the CSA Prediction Engine package and examples:
✅ Python 3.10 or Python 3.11 is required
These versions are selected to ensure stability and compatibility with key dependencies in the numerical libraries. Newer versions of Python (e.g. 3.12+) are not yet supported due to ongoing ecosystem updates and dependency stabilization.
We recommend setting up a virtual environment with one of the supported Python versions.
Installation
To install the CSA Prediction Engine package, use the following command:
pip install csa_prediction_engine
The CSA Prediction Engine relies on the CSA Common Lib, which is a required dependency. The CSA Common Lib is a shared library that provides essential components such as standardized prediction option structures, enumerations, and utility functions that enhance usability and consistency across the API ecosystem.
Before using the CSA Prediction Engine, please review the CSA Common Lib section for installation instructions and key features.
To install both the CSA Prediction Engine and the CSA Common Lib at the same time, use the following command:
pip install csa_common_lib csa_prediction_engine
Contributing
We welcome contributions to the CSA Prediction Engine package. If you find a bug or have a feature request, please reach out to the CSA support team: [email protected]
License
(c) 2023 - 2025 Cambridge Sports Analytics, LLC. All rights reserved.
Last updated