Standardize _get_scores() return type across all query strategies#197
Open
CoolJosh0221 wants to merge 1 commit intontucllab:masterfrom
Open
Standardize _get_scores() return type across all query strategies#197CoolJosh0221 wants to merge 1 commit intontucllab:masterfrom
CoolJosh0221 wants to merge 1 commit intontucllab:masterfrom
Conversation
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.
Standardize
_get_scores()to return(np.ndarray, np.ndarray)across all strategiesMotivation
_get_scores()had inconsistent return types across strategies —zipiterators,list(zip(...)), or not implemented at all. This blocks future plans for supporting batch-mode querying and ALBL soft-advice vectors, which need a uniform interface to consume scores from any strategy.Changes
Every
_get_scores()now returns(entry_ids: np.ndarray, scores: np.ndarray)where higher = more informative. Empty pools return(empty_int_array, empty_float_array). The base class default raisesNotImplementedError._get_scores()implementations (QBC, QUIRE, RandomSampling)NotImplementedError(VarianceReduction, ALBL)Backward compatibility
No public API changes.
make_query()still returnsint.return_score=Truestill returns(ask_id, list(zip(...))).Tests
24 new contract tests in
test_get_scores.pycovering return types, empty pools, andreturn_scorecompatibility. 3 existing test files updated for the new tuple format. 90/90 pass (11 pre-existing sklearn 1.8multi_classfailures are unrelated).