add sklearn version to external version in sklearn flows,#742
Merged
mfeurer merged 6 commits intoopenml:developfrom Jul 26, 2019
Merged
add sklearn version to external version in sklearn flows,#742mfeurer merged 6 commits intoopenml:developfrom
mfeurer merged 6 commits intoopenml:developfrom
Conversation
explicitly handle extension in flow creation
Collaborator
|
Yep, that should solve it, thanks for the PR. However, it seems like you forgot to add the |
Contributor
Author
|
damn, should be MyDummy now... I'll fix after lunch. |
amueller
commented
Jul 23, 2019
| self.flow_id = flow_id | ||
|
|
||
| self._extension = get_extension_by_flow(self) | ||
| if extension is None: |
Contributor
Author
There was a problem hiding this comment.
Do you want me to remove this? Would work without it but I found it more explicit to directly give the extension.
Collaborator
There was a problem hiding this comment.
This is totally fine by me.
Contributor
Author
|
probably fine now ;) |
mfeurer
requested changes
Jul 24, 2019
Collaborator
mfeurer
left a comment
There was a problem hiding this comment.
Thanks, this looks good now. However, I'm afraid that your unit test fails for scikit-learn 0.18.X:
self = <tests.test_extensions.test_sklearn_extension.test_sklearn_extension.TestSklearnExtensionRunFunctions testMethod=test_run_model_on_task>
def test_run_model_on_task(self):
class MyDummy(sklearn.dummy.DummyClassifier):
pass
task = openml.tasks.get_task(1)
> openml.runs.run_model_on_task(MyDummy(), task)
/home/travis/build/openml/openml-python/tests/test_extensions/test_sklearn_extension/test_sklearn_extension.py:1226:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/home/travis/build/openml/openml-python/openml/runs/functions.py:106: in run_model_on_task
upload_flow=upload_flow,
/home/travis/build/openml/openml-python/openml/runs/functions.py:222: in run_flow_on_task
add_local_measures=add_local_measures,
/home/travis/build/openml/openml-python/openml/runs/functions.py:446: in _run_task_get_arffcontent
X_test=test_x,
/home/travis/build/openml/openml-python/openml/extensions/sklearn/extension.py:1248: in _run_model_on_fold
pred_y = model_copy.predict(X_test)
/home/travis/miniconda/envs/testenv/lib/python3.6/site-packages/sklearn/dummy.py:174: in predict
X = check_array(X, accept_sparse=['csr', 'csc', 'coo'])
/home/travis/miniconda/envs/testenv/lib/python3.6/site-packages/sklearn/utils/validation.py:407: in check_array
_assert_all_finite(array)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
X = array([[nan, 0., 1., ..., 0., 0., nan],
[ 8., 0., 1., ..., nan, 0., nan],
[ 8., 0., 1., ..., na...nan, 0., nan],
[nan, 0., nan, ..., nan, 0., nan],
[ 8., 0., 0., ..., nan, 0., nan]], dtype=float32)
def _assert_all_finite(X):
"""Like assert_all_finite, but only for ndarray."""
X = np.asanyarray(X)
# First try an O(n) time, O(1) space solution for the common case that
# everything is finite; fall back to O(n) space np.isfinite to prevent
# false positives from overflow in sum method.
if (X.dtype.char in np.typecodes['AllFloat'] and not np.isfinite(X.sum())
and not np.isfinite(X).all()):
raise ValueError("Input contains NaN, infinity"
> " or a value too large for %r." % X.dtype)
E ValueError: Input contains NaN, infinity or a value too large for dtype('float32').
/home/travis/miniconda/envs/testenv/lib/python3.6/site-packages/sklearn/utils/validation.py:58: ValueError
Could you please check that?
Contributor
Author
|
I think the failures now are unrelated? |
mfeurer
approved these changes
Jul 26, 2019
Contributor
Author
|
ping @PGijsbers ;) |
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.
closes #734.