feat(notebooks): add 03_carbon_analysis carbon stock estimation notebook#47
Merged
Merged
Conversation
End-to-end notebook that loads (or simulates) a biomass-labelled spectral dataset, trains a Random Forest BiomassRegressor, evaluates RMSE/MAE/R^2/MAPE, converts biomass predictions to carbon and CO2e using IPCC defaults, plots feature importances, and persists the model + metrics for the analytics API and the model-card pipeline. Falls back to a synthetic dataset when the labelled parquet file is not present, so the notebook is runnable in CI.
1 task
Goldokpa
approved these changes
May 5, 2026
Member
Goldokpa
left a comment
There was a problem hiding this comment.
Nice end-to-end demonstration — the synthetic-fallback dataset means this stays runnable in CI without GEE access. Feature importances come out where you'd expect (NDVI dominant) and the saved metrics.json plugs straight into the model-card generator.
LGTM.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
notebooks/03_carbon_analysis.ipynb— end-to-end walk-through of training aBiomassRegressor, evaluating it, converting biomass to carbon and CO2e, plotting feature importances, and persisting the model + metrics.data/biomass/biomass_samples.parquetif present; otherwise simulates a 5,000-sample synthetic dataset so the notebook is runnable in CI.models_pretrained/biomass_rf.pkland the metrics tooutputs/carbon/metrics.jsonfor the analytics API and model-card pipeline.Why
Sprint deliverable: "Create 03_carbon_analysis.ipynb — Carbon estimation analysis."
Test plan
python -c 'import json; json.load(open("notebooks/03_carbon_analysis.ipynb"))'— valid notebook JSON.papermill notebooks/03_carbon_analysis.ipynb /tmp/out.ipynb.Notes for reviewers
BiomassRegressorintroduced in feat(models): add biomass and carbon-stock regression module #46; merge that first.OUTPUTSresolves correctly whether the notebook is run from the repo root or fromnotebooks/.