Added pooled scoring and robust aggregation#97
Closed
jigyasaba wants to merge 4 commits into
Closed
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #97 +/- ##
==========================================
- Coverage 92.96% 92.95% -0.02%
==========================================
Files 6 6
Lines 825 837 +12
==========================================
+ Hits 767 778 +11
- Misses 58 59 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
a4d2cb1 to
7cb1172
Compare
removed spaces
7cb1172 to
e7fa4eb
Compare
Member
|
Duplicate of #76. Also, see the discussion in there. |
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:**
This PR resolves the existing TODO regarding
score_by exposing a pooled global metric for bothGWLogisticRegressionandGWLinearRegression.Motivation:
While local models were fitted correctly in the base classes, a global summary metric consistent with the scikit-learn API (
score_) was not explicitly provided.Geographically Weighted (GW) models produce location-specific results, but users expect an overall performance summary comparable to standard sklearn estimators. This PR introduces a pooled metric based on focal predictions.
Implementation:
GWLogisticRegression
score_defined as pooled mean accuracy of focal predictions.GWLinearRegression
score_defined as pooled R² computed from focal predictions.ss_tot) equals zero.The design uses focal predictions rather than weighted aggregation, ensuring consistency with the interpretation of GW estimators as a spatial ensemble of local models.
Impact:
min_proportion.All existing tests pass locally.
Open to feedback and suggestions.