parse_subprocess_eval_stdout
model_executor.parse_subprocess_eval_stdout
Parse model_executor subprocess stdout into the per-window evaluation list.
Prefer the sentinel line (current protocol). Otherwise scan from the end: the real json.dumps(outputs) line is almost always last, while stray [...] lines from dependencies often appear earlier and used to be mistaken for the payload.
| Parameter | Type | Default | Description |
|---|---|---|---|
stdout |
str |
- | (undocumented) |
Returns: list (undocumented).
ModelExecutor
model_executor.ModelExecutor
Executes a single model inside its dedicated Conda environment.
The executor prepares the command-line invocation, ensures the requested environment is available, and parses JSON results emitted by the child process. This isolation allows different models to have conflicting dependencies without interference.
__init__(self, job_config: Dict)
Initialize the executor with execution metadata.
| Parameter | Type | Default | Description |
|---|---|---|---|
job_config |
Dict |
- | Job configuration object. |
execute_model(self, hyperparameters: dict, context_steps: int, train_steps: int, validate_steps: int) -> dict
Execute a single model with specific hyperparameters on dataset windows.
This method creates or uses an existing conda environment for the model, executes the model via CLI with the specified hyperparameters, and processes the results across multiple rolling windows of the dataset.
| Parameter | Type | Default | Description |
|---|---|---|---|
hyperparameters |
dict |
- | Concrete hyperparameter assignment to forward to the model. |
context_steps |
int |
- | Number of context steps extracted from each window. |
train_steps |
int |
- | Number of steps used for fitting inside each window. |
validate_steps |
int |
- | Number of steps reserved for evaluation. |
Returns: dict (List of dictionaries containing evaluation metrics and optional artifacts (predictions, true values) produced by the model for each window. Each dictionary contains metrics and results for one window.)
Raises:
* RuntimeError: If model execution fails in the conda environment.
* ValueError: If no valid JSON output is found in command results.
main
model_executor.main
CLI entry point for executing a model with specific hyperparameters.
This function parses command-line arguments, loads the job configuration, executes the model across multiple rolling windows, and outputs evaluation results as JSON. The model is loaded dynamically based on the model name, and predictions are computed for each validation window.
| Parameter | Type | Default | Description |
|---|---|---|---|
| (No parameters, arguments are parsed from CLI) |
Returns: None (Results are printed to stdout as JSON.)
Raises:
* ImportError: If the model module cannot be loaded.
* ValueError: If required arguments are missing or invalid.