A batch processing job that computes rolling mean signals on OHLCV data.
- Python 3.x+ (preferably 3.9+)
- pip
- Install dependencies:
pip install -r requirements.txt- Run the script:
python run.py --input data.csv --config config.yaml --output metrics.json --log-file run.logdocker build -t mlops-task .docker run --rm mlops-taskmetrics.json- metrics in JSON formatrun.log- detailed execution logs with timestamps (no overwriting)
{
"version": "v1",
"rows_processed": 10000,
"metric": "signal_rate",
"value": 0.4990,
"latency_ms": 491,
"seed": 42,
"status": "success"
}- (Missing column error)
{
"version": "v1",
"status": "error",
"error_message": "Missing column in data.csv: close"
}- Rolling Mean Handling : The first (window-1) rows have NaN rolling mean values since there aren't enough previous values to calculate the average. These rows are treated as signal=0 (no signal).
- No Columns Errors handled
- No Config details handled
- No file detected
run.py- Main scriptconfig.yaml- Configuration (seed, window, version)data.csv- OHLCV datarequirements.txt- Python dependenciesDockerfile- Docker configuration