Entry point: st-forecast
train - Train a forecasting model
predict - Generate hindcast predictions
evaluate - Evaluate predictions against observations
visualize - Generate visualizations
pipeline - Run complete end-to-end workflow
Train a forecasting model.
st-forecast train RUN_FOLDER [OPTIONS]
| Argument |
Description |
RUN_FOLDER |
Directory where artifacts will be saved |
| Option |
Type |
Default |
Description |
--config, -c |
PATH |
None |
Path to config.json. Copied to run folder if not already present |
--seed |
INT |
42 |
Random seed for reproducibility |
st-forecast train ./runs/experiment_01 --config configs/my_config.json --seed 123
{model_name}.pt - Trained model checkpoint
scalers/ - Fitted scalers for data normalization
train_loss.csv - Training loss history
val_loss.csv - Validation loss history
Generate hindcast predictions using a trained model.
st-forecast predict RUN_FOLDER [OPTIONS]
| Argument |
Description |
RUN_FOLDER |
Directory containing config.json, scalers, and trained model |
| Option |
Type |
Default |
Description |
--split, -s |
CHOICE |
test |
Data split to run hindcast on (train, val, test) |
--num-samples |
INT |
config value |
Number of samples for probabilistic forecasting |
--num-workers |
INT |
config value |
Number of DataLoader workers for faster inference |
st-forecast predict ./runs/experiment_01 --split test --num-samples 500
predictions/{split}_predictions.parquet - Predictions with quantiles
Evaluate model predictions against observations.
st-forecast evaluate RUN_FOLDER [OPTIONS]
| Argument |
Description |
RUN_FOLDER |
Directory containing config.json and predictions/ directory |
| Option |
Type |
Default |
Description |
--split, -s |
CHOICE |
test |
Data split to evaluate (train, val, test) |
--agricultural-only |
FLAG |
False |
Filter to agricultural period (months 4-9) |
st-forecast evaluate ./runs/experiment_01 --split test --agricultural-only
metrics/{split}_performance.parquet - Per-basin, per-lead-time metrics (NSE, nRMSE, nMAE)
metrics/{split}_probabilistic.parquet - Probabilistic calibration metrics
metrics/{split}_flood.parquet - Flood detection metrics
Generate visualizations from model evaluation results.
st-forecast visualize RUN_FOLDER [OPTIONS]
| Argument |
Description |
RUN_FOLDER |
Directory containing config.json and metrics/ directory |
| Option |
Type |
Default |
Description |
--split, -s |
CHOICE |
test |
Data split to visualize (train, val, test) |
--all-plots |
FLAG |
False |
Generate all plots |
--metrics |
FLAG |
False |
Generate metric boxplots (NSE, nRMSE, nMAE) |
--flood |
FLAG |
False |
Generate flood metric plots |
--probabilistic |
FLAG |
False |
Generate probabilistic calibration plots |
--loss |
FLAG |
False |
Generate training loss plot |
--forecasts |
FLAG |
False |
Generate example forecast plots |
--agricultural-only |
FLAG |
False |
Use agricultural period metrics (months 4-9) |
# Generate all plots
st-forecast visualize ./runs/experiment_01 --all-plots
# Generate specific plots
st-forecast visualize ./runs/experiment_01 --metrics --probabilistic
figures/ - PNG files for each requested plot type
Run the complete forecasting pipeline: train → predict → evaluate → visualize.
st-forecast pipeline RUN_FOLDER [OPTIONS]
| Argument |
Description |
RUN_FOLDER |
Directory where all artifacts will be saved |
| Option |
Type |
Default |
Description |
--config, -c |
PATH |
None |
Path to config.json. Copied to run folder if not already present |
--seed |
INT |
42 |
Random seed for training |
--split, -s |
CHOICE |
test |
Data split for prediction/evaluation/visualization |
--num-samples |
INT |
config value |
Number of samples for probabilistic forecasting |
--num-workers |
INT |
config value |
Number of DataLoader workers |
--agricultural-only |
FLAG |
False |
Filter evaluation to agricultural period (months 4-9) |
--all-plots/--no-all-plots |
FLAG |
True |
Generate all visualization plots |
st-forecast pipeline ./runs/full_run \
--config configs/production.json \
--split test \
--num-samples 500 \
--agricultural-only
All outputs from train, predict, evaluate, and visualize commands:
- Model checkpoint and scalers
- Loss histories
- Predictions parquet
- Evaluation metrics
- Visualization figures