How wur-ai/agml-cy-bench works
CY-Bench is a Python library and benchmark for subnational, in-season maize and wheat yield forecasting. The principal workflow is to load a configured crop dataset, align predictors to crop seasons and forecast cutoffs, train models on training years, predict held-out years, and evaluate forecasts. The repository also provides feature engineering, multiple model families, result processing and visualizations, plus data-preparation utilities. Relationships are limited to calls or references shown in excerpts, the source index, or README; several result and preparation details are only documented or indexed, not inspected in full.
Main entry points: run_benchmark.py Benchmark runner · torch_dataset.py Torch dataset · alignment.py Season alignment · configured.py Configured datasets
Components 29
Data and features
- Benchmark config
cybench/config.py - Configured datasets
cybench/datasets/configured.py - Season alignment
cybench/datasets/alignment.py - Dataset samples
cybench/datasets/dataset.py - Torch dataset
cybench/datasets/torch_dataset.py - Feature engineering
cybench/util/features.py - Data utilities
cybench/util/data.py - Torch utilities
cybench/util/torch.py
Modeling
- Model interface
cybench/models/model.py - Naive models
cybench/models/naive_models.py - Trend models
cybench/models/trend_models.py - Scikit-learn models
cybench/models/sklearn_models.py - XGBoost model
cybench/models/xgboost_model.py - Neural models
cybench/models/nn_models.py - Residual models
cybench/models/residual_models.py
Benchmark and evaluation
- Benchmark runner
cybench/runs/run_benchmark.py - Forecast metrics
cybench/evaluation/eval.py - Experiment logging
cybench/evaluation/log_experiments.py
Results and reporting
- Result processing
cybench/runs/process_results.py - Result plots
cybench/runs/results_plots.py - Forecast maps
cybench/runs/visualize_results.py - Aggregated maps
cybench/runs/visualize_results_aggregated.py - Boundary utilities
cybench/util/geo.py
Data preparation
- Predictor preparation
data_preparation/predictor_data_prep.py - Predictor filtering
data_preparation/filter_predictor_data.py - Yield filtering
data_preparation/filter_yield_data.py - Coverage views
data_preparation/visualize_coverage.py
Other components
- Benchmark user
- Comet ML
Connections 35
- Benchmark user → Benchmark runner: starts benchmark
README.md - Benchmark runner → Configured datasets: loads dataset
cybench/runs/run_benchmark.py - Configured datasets → Season alignment: aligns inputs
cybench/datasets/configured.py - Configured datasets → Benchmark config: reads settings
cybench/datasets/configured.py - Dataset samples → Configured datasets: uses loader
cybench/datasets/dataset.py - Season alignment → Feature engineering: uses date features
cybench/datasets/alignment.py - Season alignment → Data utilities: converts data
cybench/datasets/alignment.py - Season alignment → Benchmark config: reads settings
cybench/datasets/alignment.py - Torch dataset → Dataset samples: wraps samples
cybench/datasets/torch_dataset.py - Torch dataset → Torch utilities: uses utilities
cybench/datasets/torch_dataset.py - Torch dataset → Data utilities: uses utilities
cybench/datasets/torch_dataset.py - Torch dataset → Season alignment: uses alignment
cybench/datasets/torch_dataset.py - Model interface → Dataset samples: fits and predicts
cybench/models/model.py - Benchmark runner → Model interface: constructs models
cybench/runs/run_benchmark.py - Benchmark runner → Naive models: dispatches model
cybench/runs/run_benchmark.py - Benchmark runner → Trend models: dispatches model
cybench/runs/run_benchmark.py - Benchmark runner → Scikit-learn models: dispatches model
cybench/runs/run_benchmark.py - Benchmark runner → XGBoost model: dispatches model
cybench/runs/run_benchmark.py - Benchmark runner → Neural models: dispatches model
cybench/runs/run_benchmark.py - Benchmark runner → Residual models: dispatches model
cybench/runs/run_benchmark.py - Neural models → Torch dataset: uses batches
cybench/models/nn_models.py - Benchmark runner → Forecast metrics: computes metrics
cybench/runs/run_benchmark.py - Forecast metrics → Model interface: requests predictions
cybench/evaluation/eval.py - Forecast metrics → Dataset samples: reads targets
cybench/evaluation/eval.py - Result processing → Benchmark runner: reads run results
cybench/runs/process_results.py - Result processing → Forecast metrics: uses metrics
cybench/runs/process_results.py - Result plots → Result processing: uses processed results
cybench/runs/results_plots.py - Result plots → Benchmark runner: reads run results
cybench/runs/results_plots.py - Forecast maps → Boundary utilities: loads boundaries
cybench/runs/visualize_results.py - Aggregated maps → Boundary utilities: loads boundaries
cybench/runs/visualize_results_aggregated.py - Experiment logging → Comet ML: logs experiments
cybench/evaluation/log_experiments.py - Predictor filtering → Benchmark config: uses settings
data_preparation/filter_predictor_data.py - Predictor preparation → Benchmark config: uses settings
data_preparation/predictor_data_prep.py - Coverage views → Boundary utilities: uses boundaries
data_preparation/visualize_coverage.py - Benchmark runner → Experiment logging: logs benchmark
cybench/evaluation/log_experiments.py