Skip to content

Use the EGI coefficient in irrigation probability - #249

Open
Renato L. de F. Cunha (renatolfc) wants to merge 3 commits into
microsoft:mainfrom
renatolfc:fix/issue-223-irrigation-egi
Open

Use the EGI coefficient in irrigation probability#249
Renato L. de F. Cunha (renatolfc) wants to merge 3 commits into
microsoft:mainfrom
renatolfc:fix/issue-223-irrigation-egi

Conversation

@renatolfc

Copy link
Copy Markdown
Contributor

The irrigation callback accepts separate NGI and EGI coefficients, but the fitted logistic model currently inserts the NGI value twice. That silently gives every probability calculation the wrong EGI weight.

This PR changes the duplicated entry to coef_egi. A focused regression uses distinct values and checks the model vector directly.

Addresses the implementation defect found while investigating #223.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes an implementation defect in the compute_irrigation_probability op where the EGI coefficient was not being applied (NGI was used twice), which would silently bias irrigation probability outputs. Adds a focused regression test to ensure distinct NGI/EGI coefficients are wired into the model correctly.

Changes:

  • Correct logistic regression coefficient vector to use coef_egi for the EGI feature.
  • Add a regression unit test that captures the model coefficient vector and asserts NGI/EGI/LST coefficients are distinct as provided.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
ops/compute_irrigation_probability/compute_irrigation_probability.py Fixes coefficient wiring so EGI uses coef_egi instead of duplicating NGI.
ops/compute_irrigation_probability/test_compute_irrigation_probability.py Adds regression coverage to prevent reintroducing the NGI/EGI coefficient mix-up.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +32 to +33
with pytest.raises(RuntimeError, match="stop after coefficient capture"):
CallbackBuilder(1.0, 2.0, 3.0, 4.0)()(landsat, ngi, egi, lst, cloud_mask) # type: ignore

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

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.

2 participants