Coordinator Class
omnirec.runner.coordinator.Coordinator(checkpoint_dir: PathLike | str = Path('./checkpoints'), tmp_dir: Optional[PathLike | str] = None)
Initialize the Coordinator for orchestrating recommendation algorithm experiments. The Coordinator manages the execution of experiments across multiple datasets, algorithms, and configurations. It handles environment isolation, checkpointing, progress tracking, and communication with framework-specific runners.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
checkpoint_dir
|
PathLike | str
|
Directory for storing persistent experiment data including model checkpoints, predictions, and progress files. Directory is created if it doesn't exist. Defaults to "./checkpoints". |
Path('./checkpoints')
|
tmp_dir
|
Optional[PathLike | str]
|
Directory for temporary files such as intermediate CSV exports. If None, a temporary directory is created automatically and cleaned up on exit. Defaults to None. |
None
|
Note
- Automatically registers default runners (LensKit, RecBole, RecPack) on initialization
- Generates SSL certificates for secure RPC communication with runner subprocesses
- The checkpoint directory structure is:
checkpoint_dir/dataset-hash/config-hash/
Source code in src\omnirec\runner\coordinator.py
run(datasets: RecSysDataSet[T] | Iterable[RecSysDataSet[T]], config: ExperimentPlan, evaluator: Evaluator) -> Evaluator
Execute recommendation algorithm experiments across datasets and configurations. Orchestrates the complete experiment lifecycle: environment setup, model training, prediction generation, and evaluation. Supports automatic checkpointing and resuming of interrupted experiments.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
datasets
|
RecSysDataSet[T] | Iterable[RecSysDataSet[T]]
|
Single dataset or list of datasets to run experiments on. Datasets must contain either SplitData (train/val/test) or FoldedData (cross-validation folds). Use preprocessing steps to create these splits. |
required |
config
|
ExperimentPlan
|
Experiment configuration specifying algorithms and their hyperparameters. Each algorithm in the plan will be executed with all specified parameter combinations. |
required |
evaluator
|
Evaluator
|
Evaluator instance containing metrics to compute on predictions.
Results are accumulated across all experiments and accessible via |
required |
Returns:
| Name | Type | Description |
|---|---|---|
Evaluator |
Evaluator
|
The same evaluator instance passed in, now containing results from all experiments.
Use |
Raises:
| Type | Description |
|---|---|
SystemExit
|
If the experiment plan is empty or if runner/algorithm validation fails. |
Note
- Each algorithm runs in an isolated Python environment with framework-specific dependencies
- Progress is checkpointed after each phase (Fit, Predict, Eval) for fault tolerance
- Identical dataset/config combinations are cached and skipped automatically
- For cross-validation (FoldedData), experiments run sequentially across all folds
- Runner subprocesses are automatically started and terminated for each algorithm
Source code in src\omnirec\runner\coordinator.py
78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 | |