Skip to content

Commit db77adb

Browse files
Release 1.2.0 (#1115)
# Version 1.2.0 This is a smaller release, most changes concern examples and development and thus don't affect users of skorch. ## Changed - Loading of skorch nets using pickle: When unpickling a skorch net, you may come across a PyTorch warning that goes: "FutureWarning: You are using torch.load with weights_only=False [...]"; to avoid this warning, pickle the net again and use the new pickle file (#1092) ## Added - Add Contributing Guidelines for skorch. (#1097) - Add an example of hyper-parameter optimization using [Optuna](https://optuna.org/) [here](https://github.com/skorch-dev/skorch/tree/master/examples/optuna) (#1098) - Add Example for Streaming Dataset(#1105) - Add pyproject.toml to Improve CI/CD and Tooling (#1108) Thanks @raphaelrubrice, @omahs, and @ParagEkbote for their contributions. **Full Changelog**: v1.1.0...v1.2.0 Release commit specific: * Bump verison to 1.2.0 * Update CHANGES.md * Remove workarounds that have been fixed in sklearn Only affects tests
1 parent 4378f31 commit db77adb

File tree

4 files changed

+11
-21
lines changed

4 files changed

+11
-21
lines changed

CHANGES.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
99

1010
### Added
1111

12+
### Changed
13+
14+
### Fixed
15+
16+
## [1.2.0]
17+
18+
### Added
19+
1220
- Add Contributing Guidelines for skorch. (#1097)
1321
- Add an example of hyper-parameter optimization using [Optuna](https://optuna.org/) [here](https://github.com/skorch-dev/skorch/tree/master/examples/optuna) (#1098)
1422
- Add Example for Streaming Dataset(#1105)

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.1.1dev
1+
1.2.0

skorch/tests/test_classifier.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -172,12 +172,7 @@ def test_pass_empty_classes_raises(
172172
expected = "NeuralNetClassifier has no attribute 'classes_'"
173173
assert msg == expected
174174

175-
@pytest.mark.xfail
176175
def test_with_calibrated_classifier_cv(self, net_fit, data):
177-
# TODO: This fails with sklearn 1.4.0 because CCCV does not work when
178-
# y_proba is float32. This will be fixed in
179-
# https://github.com/scikit-learn/scikit-learn/pull/28247, at which
180-
# point the test should pass again and the xfail can be removed.
181176
from sklearn.calibration import CalibratedClassifierCV
182177
cccv = CalibratedClassifierCV(net_fit, cv=2)
183178
cccv.fit(*data)
@@ -381,12 +376,7 @@ def test_default_loss_does_call_sigmoid(
381376
net.predict_proba(X)
382377
assert mock.call_count > 0
383378

384-
@pytest.mark.xfail
385379
def test_with_calibrated_classifier_cv(self, net_fit, data):
386-
# TODO: This fails with sklearn 1.4.0 because CCCV does not work when
387-
# y_proba is float32. This will be fixed in
388-
# https://github.com/scikit-learn/scikit-learn/pull/28247, at which
389-
# point the test should pass again and the xfail can be removed.
390380
from sklearn.calibration import CalibratedClassifierCV
391381
cccv = CalibratedClassifierCV(net_fit, cv=2)
392382
cccv.fit(*data)

skorch/tests/test_helper.py

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -437,7 +437,6 @@ def test_grid_search_with_slds_works(
437437
self, slds, y, classifier_module):
438438
from sklearn.model_selection import GridSearchCV
439439
from skorch import NeuralNetClassifier
440-
from skorch.utils import to_numpy
441440

442441
net = NeuralNetClassifier(
443442
classifier_module,
@@ -451,16 +450,12 @@ def test_grid_search_with_slds_works(
451450
gs = GridSearchCV(
452451
net, params, refit=False, cv=3, scoring='accuracy', error_score='raise'
453452
)
454-
# TODO: after sklearn > 1.6 is released, the to_numpy call should no longer be
455-
# required and be removed, see:
456-
# https://github.com/skorch-dev/skorch/pull/1078#discussion_r1887197261
457-
gs.fit(slds, to_numpy(y)) # does not raise
453+
gs.fit(slds, y) # does not raise
458454

459455
def test_grid_search_with_slds_and_internal_split_works(
460456
self, slds, y, classifier_module):
461457
from sklearn.model_selection import GridSearchCV
462458
from skorch import NeuralNetClassifier
463-
from skorch.utils import to_numpy
464459

465460
net = NeuralNetClassifier(classifier_module)
466461
params = {
@@ -470,10 +465,7 @@ def test_grid_search_with_slds_and_internal_split_works(
470465
gs = GridSearchCV(
471466
net, params, refit=True, cv=3, scoring='accuracy', error_score='raise'
472467
)
473-
# TODO: after sklearn > 1.6 is released, the to_numpy call should no longer be
474-
# required and be removed, see:
475-
# https://github.com/skorch-dev/skorch/pull/1078#discussion_r1887197261
476-
gs.fit(slds, to_numpy(y)) # does not raise
468+
gs.fit(slds, y) # does not raise
477469

478470
def test_grid_search_with_slds_X_and_slds_y(
479471
self, slds, slds_y, classifier_module):

0 commit comments

Comments
 (0)