Skip to content

feat: evaluate metrics JSON, v1.3.0 improvements - #3

Merged
johnma96 merged 3 commits into
mainfrom
develop
May 14, 2026
Merged

johnma96 merged 3 commits into
mainfrom
develop

Conversation

@johnma96

Copy link
Copy Markdown
Owner

No description provided.

Mario added 3 commits May 14, 2026 16:27
perf(inference): replace nested Python loop with vectorised NumPy indexing
  - scipy maximum_filter computes NaN-neighbourhood mask in one C pass
  - Advanced indexing gathers all patches simultaneously (no Python loop)
  - Estimated speedup: ~30 min -> ~2 min on 3660x3438 image
  - test_predict_vectorized.py: 7 tests validating shape, dtype, NaN
    exclusion, border exclusion, numerical match vs. loop reference

fix(train): refit RobustScaler on training split for each new dataset
  - Fitting scaler on train_flat pixels before patch extraction
  - Saves robust_scaler.pkl alongside model weights in output_dir
  - Resolves incorrect scaling when training with a different image

refactor(src): delete 6 empty stub files from spectralcrop/
  - Removed: make_dataset.py, generate_features.py, predict_model.py,
    train_model.py, backtesting.py, visualize.py (all 0 KB)

test: add test_preprocessing.py and test_training_loop.py
  - Coverage: 18% -> 40%
  - test_preprocessing: nearest band lookup, add_vegetation_indices
    with synthetic zarr (zarr.open_group + dimension_names pattern)
  - test_training_loop: fit_cnn2d runs, eval mode, early stopping,
    loss decrease on separable data

feat(dvc): add dvc.yaml declarative pipeline + params.yaml
  - 5 stages: preprocess, make_labels, make_split, train, evaluate
  - deps/outs/params declared for each stage
  - `dvc repro` reruns only outdated stages

docs: add GCP deployment proposal (docs/gcp_deployment_proposal.md)
  - Cloud Run Jobs (batch 9.5 GB images) + Cloud Run Service (REST API)
  - Cost estimate, Terraform snippet, 4-sprint implementation plan
- Add --output-metrics option (default: reports/metrics_retrain.json)
- Output format: {split: {metric: value}} compatible with dvc metrics diff
- Update dvc.yaml evaluate stage to pass --output-metrics explicitly
- dvc repro + dvc metrics diff now fully functional end-to-end
@dagshub

dagshub Bot commented May 14, 2026

Copy link
Copy Markdown

@johnma96
johnma96 merged commit 7584aa6 into main May 14, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant