API Reference¶
Generated from source docstrings. The package is laid out flat by responsibility — each page below documents one module.
| Module | Responsibility |
|---|---|
recommender |
The engine — strategies, MVT swap, substitute search, top-up, RecommendationResult. |
engine |
Substrate-agnostic input contracts (EngineState, SimilarityMatrix) + adapters. |
data |
Read side (CohortRepository, Cohort) + write side (PrescriptionStore) + clinical mappers. |
pipeline |
Cohort → scored frame: windowing, feature merge, imputation, scoring. Typed stage contracts. |
precompute |
Offline PPF + protocol-similarity computation/persistence. |
service |
RecommendationService — the application orchestrator. |
Entry points¶
from ai_cdss import RecommendationService # production: DB -> score -> recommend -> persist
from ai_cdss.recommender import Recommender # engine: one patient, any substrate
The architectural seams are all structural Protocols — EngineState,
CohortRepository, PrescriptionStore — so substrates (pandas, dict,
synthetic) and sources (DB, in-memory) are swappable without touching
the engine. See Architecture.