Fix get_flow() with reinstantiate=True for flows without extensions - #1733
Open
JaySingh79 wants to merge 1 commit into
Open
Fix get_flow() with reinstantiate=True for flows without extensions#1733JaySingh79 wants to merge 1 commit into
JaySingh79 wants to merge 1 commit into
Conversation
Modify get_flow() to gracefully handle flows without registered extensions when reinstantiate=True is passed. Log a warning instead of raising ValueError when no extension is available. Return flow with model=None when reinstantiation is not possible. Update docstring to document new behavior. Add tests for OpenML-native flows. Fixes openml#1626
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.
Metadata
No extension registered which can handle flowwhen using 'get_flow()' withreinstantiate=True聽#1626Details
Problem:
Calling
openml.flows.get_flow(1, reinstantiate=True)(or any flow without a registered extension, e.g.,openml.evaluation.EuclideanDistanceorweka.SMO) raisedValueError: No extension registered which can handle flow: 1 (...).Root cause:
get_flow()directly accessedflow.extensionwhich callsget_extension_by_flow(..., raise_if_no_extension=True).Solution:
get_flow()inopenml/flows/functions.pyto check for extension availability viaflow._extensionandget_extension_by_flow(..., raise_if_no_extension=False)strict_versionhandling)WARNINGvialogging.getLogger(__name__)and return flow withmodel=Noneinstead of raisingTesting:
test_get_flow_reinstantiate_model_no_extensionto assert warning andmodel is Noneinstead ofValueErrortest_get_flow_reinstantiate_openml_native_flowfor issue [BUG] Error:No extension registered which can handle flowwhen using 'get_flow()' withreinstantiate=True聽#1626 verification withflow_id=1openml._backend.flow.getforopenml.evaluation.EuclideanDistance,weka.SMO, and sklearnDecisionTreeClassifier(reinstantiates correctly)test_are_flows_equaletc.)