-
Notifications
You must be signed in to change notification settings - Fork 394
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MNT: Update CI, add Python 3.11, fix sklearn issues #990
Conversation
Use latest versions.
PyTorch 2.0.1 should now run with Python 3.11. As to earlier PyTorch versions, it's not quite clear to me, let's see and if they don't, exclude them.
Makes errors from failing tests easier to read.
Something somewhere in sklearn changed that now requires the presence of the classes_ attribute on classifiers when scoring. That attribute is not always present. Now, more of an effort is made to infer the classes when a dataset is passed. Together with the previous commit that enables extraction of y from TensorDatasets, this makes a test pass that failed otherwise with the new sklearn version.
An sklearn error message that we checked was changed, resulting in the corresponding tests to fail. This commit fixes the error message checked in the test (which was already quite defensive beforehand).
Strange, according to this, PyTorch 2.0.1 should work with Python 3.11 but the CI fails with:
|
Otherwise, outputs are squished on GH action log.
@BenjaminBossan I don't believe the person that made that comment works on PyTorch. |
Yes, I had still hoped they were telling the truth :D |
Explicitly test that when fitting with a TensorDataset, the NeuralNetClassifier still manages to set the classes_ attribute.
Updated description
checkout
andsetup-python
GH actionsclasses_
attribute is now required on classifiers for some stuff related to sklearn scoring, where previously it wasn't, which resulted in some errors when we use non-skorchDataset
s (which so far didn't set the attribute). There is now a fix in place that extractsy
fromTensorDataset
s, making a failing test pass again. Other datasets could still fail, but I don't think we can write generic code that extractsy
from all types of datasets (we want to avoid iterating over the dataset). For those, users would have to either use an older sklearn version or passy
explicitly tofit
.Regarding the last point, I think the change of trying to infer the classes from a dataset should not make existing code break 🤞
*PyTorch 2.0.1 does not work, even though it supposedly should, see comment below