Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Bugfix: sklearn 0.22 #571
Currently, skorch won't work with sklearn 0.22 because some code was changed that is more geared towards sklearn-internal use, which we, however, relied upon.
A list of failures:
from sklearn.utils import safe_indexing # or _safe_indexing import numpy as np X = np.zeros((5, 3)) i = ([2, 4, 1, 0, 3], [1, 0, 2, 2, 1]) safe_indexing(X, i)
This is solved by not using
The changes were tested with scikit-learn=0.21.3 and scikit-learn==0.22 (no GPU).
Furthermore, pylint now complains about imports that are not at top level (basically about all our tests), which is why I blankly removed that warning.
The util module has been in this gray area regarding changing behavior, as stated in https://scikit-learn.org/stable/developers/utilities.html under “warning”. Historically this policy was put into place, because public functions were put into utils without throughly testing its functionality.
I see how these types of changes can be a bit painful. Going forward, if sklearn wants to better support an ecosystem of estimators, I think sklearn needs to consider some of its utils as “first class” (this means deprecations) and not this gray area. I’ll be sure to bring this up with the rest of the team.
Interesting. I didn't know that.
sklearn is a huge codebase, so these things are bound to happen. I think it's especially important to communicate these kind of changes in the release notes.