Skip to content

Commit 68b2953

Browse files
committed
added tests
1 parent 3f5a461 commit 68b2953

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,8 @@ Each model contains:
182182
trained_model = data[0][1].output.model
183183
trained_model.predict(np.random.rand(1, 30))
184184
```
185+
Please check the value of `data[N][0]` to ensure that you are not using
186+
a permuted model.
185187
- One figure per metric with performance distribution across splits (with or
186188
without null distribution trained on permuted labels)
187189
- One figure per any metric with the word `score` in it reporting the results of

pydra_ml/tests/test_classifier.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import os
22
from ..classifier import gen_workflow, run_workflow
3+
import numpy as np
34

45

56
def test_classifier(tmpdir):
@@ -32,6 +33,8 @@ def test_classifier(tmpdir):
3233
assert results[0][0]["ml_wf.clf_info"][1] == "MLPClassifier"
3334
assert results[0][0]["ml_wf.permute"]
3435
assert results[0][1].output.score[0][0] < results[1][1].output.score[0][0]
36+
assert hasattr(results[2][1].output.model, "predict")
37+
assert isinstance(results[2][1].output.model.predict(np.ones((1, 30))), np.ndarray)
3538

3639

3740
def test_regressor(tmpdir):
@@ -69,3 +72,5 @@ def test_regressor(tmpdir):
6972
assert results[0][0]["ml_wf.clf_info"][-1][1] == "MLPRegressor"
7073
assert results[0][0]["ml_wf.permute"]
7174
assert results[0][1].output.score[0][0] < results[1][1].output.score[0][0]
75+
assert hasattr(results[2][1].output.model, "predict")
76+
assert isinstance(results[2][1].output.model.predict(np.ones((1, 10))), np.ndarray)

0 commit comments

Comments
 (0)