ADD raise exception when failing to create sklearn flow by mfeurer · Pull Request #479 · openml/openml-python · GitHub
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions doc/progress.rst
9 changes: 5 additions & 4 deletions openml/flows/flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -313,12 +313,13 @@ def _from_dict(cls, xml_dict):
# try to parse to a model because not everything that can be
# deserialized has to come from scikit-learn. If it can't be
# serialized, but comes from scikit-learn this is worth an exception
try:
if (
arguments['external_version'].startswith('sklearn==')
or ',sklearn==' in arguments['external_version']
):
from .sklearn_converter import flow_to_sklearn
model = flow_to_sklearn(flow)
except Exception as e:
if arguments['external_version'].startswith('sklearn'):
raise e
else:
model = None
flow.model = model

Expand Down
8 changes: 2 additions & 6 deletions openml/flows/sklearn_converter.py