Add score_ attribute based on pooled local model performance (BaseClassifier) - #118
Closed
jigyasaba wants to merge 16 commits into
Closed
Add score_ attribute based on pooled local model performance (BaseClassifier)#118jigyasaba wants to merge 16 commits into
jigyasaba wants to merge 16 commits into
Conversation
up# the commit. all clean
…ysal#117) Bumps the github-actions group with 1 update: [actions/github-script](https://github.com/actions/github-script). Updates `actions/github-script` from 8 to 9 - [Release notes](https://github.com/actions/github-script/releases) - [Commits](actions/github-script@v8...v9) --- updated-dependencies: - dependency-name: actions/github-script dependency-version: '9' dependency-type: direct:production update-type: version-update:semver-major dependency-group: github-actions ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #118 +/- ##
==========================================
+ Coverage 92.35% 92.42% +0.06%
==========================================
Files 6 6
Lines 876 884 +8
==========================================
+ Hits 809 817 +8
Misses 67 67 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Contributor
Author
|
pre-commit.ci autofix |
for more information, see https://pre-commit.ci
Member
|
This is a duplicate of #76. Please see the discussion 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.
This PR introduces a score_ attribute to BaseClassifier, computed after fit() for convenient access to training performance.
Motivation:
There has been some ambiguity around how model performance is evaluated, as discussed in Issue #30 (API consistency for metrics). Currently, .score() relies on predict(), which uses an ensemble of local models. However, during training we already compute local model outputs that can be aggregated more directly.
This PR follows the direction outlined in the discussion and TODO:
TODO: score_ should be an alias of pooled_score_(linear_model.py)
Implementation:
Added computation of pooled_score_ using:
concatenated _y_local
concatenated _pred_local
Defined:
self.score_ = self.pooled_score_
This ensures:
score_ reflects pooled local model performance
avoids confusion with .score() (ensemble-based)
(Not reused .score() which uses predict() which ultimately uses ensemble of local models instead used score_ which uses pooled local model outputs)
Tests:
score_attribute exists
score_matches pooled_score_
value is within valid range
(Applies only to BaseClassifier for now and does not modify existing .score() behavior)
Open to feedbacks and suggestions.